Replay: print timestamp every 5 seconds (#20752)

* Replay: print timestamp every 5 seconds

* include abs

* rename last_print
albatross
iejMac 2021-04-26 14:37:34 -07:00 committed by GitHub
parent 754c6f4e62
commit a759c12c1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,4 @@
#include <cmath>
#include <string>
#include <vector>
#include <capnp/dynamic.h>
@ -126,6 +127,13 @@ void Unlogger::process(SubMaster *sm) {
tc = tm;
if (it != socks.end()) {
long etime = tm-t0;
float timestamp = etime/1e9;
if(std::abs(timestamp-last_print) > 5.0){
last_print = timestamp;
printf("at %f\n", last_print);
}
long rtime = timer.nsecsElapsed() - t0r;
long us_behind = ((etime-rtime)*1e-3)+0.5;
if (us_behind > 0) {

View File

@ -31,6 +31,7 @@ Q_OBJECT
QMap<std::string, PubSocket*> socks;
Context *ctx;
uint64_t tc = 0;
float last_print = 0;
uint64_t seek_request = 0;
bool paused = false;
bool loading_segment = false;