So far, such a primitive version of the timer is working successfully: the first time you click on the timer start button (if this parameter is not set in the session, it is considered that pressing is the first) the current time is recorded in the session:
session.setAttribute("startTime", System.currentTimeMillis())
Then an AJAX survey is organized on the client. At certain intervals, the client sends a request to the server. On the server, the time is determined by the elementary formula:
time = System.currentTimeMillis() - session.getAttribute("startTime")
Thus it turns out to achieve normal accuracy. And to me personally, this solution seems more acceptable than the timer on the client side, the value of which is sent to the server as a parameter during the next survey.