File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -426,12 +426,13 @@ void Groot2Publisher::serverLoop()
426426 if (cmd == " start" )
427427 {
428428 _p->recording = true ;
429- auto now = std::chrono::system_clock::now ();
430-
431- _p->recording_fist_time = std::chrono::duration_cast<std::chrono::microseconds>
432- (now.time_since_epoch ());
433-
434- reply_msg.addstr (std::to_string (_p->recording_fist_time .count ()));
429+ // to keep the first time for callback
430+ _p->recording_fist_time = std::chrono::duration_cast<std::chrono::microseconds>(
431+ std::chrono::high_resolution_clock::now ().time_since_epoch ());
432+ // to send consistent time for client
433+ auto now = std::chrono::duration_cast<std::chrono::microseconds>(
434+ std::chrono::system_clock::now ().time_since_epoch ());
435+ reply_msg.addstr (std::to_string (now.count ()));
435436 std::unique_lock<std::mutex> lk (_p->status_mutex );
436437 _p->transitions_buffer .clear ();
437438 }
You can’t perform that action at this time.
0 commit comments