I’m confused why only TempoClock
has elapsedBeats
to return the physical time. I see that SystemClock
has no such method and SystemClock.seconds
actually tail-calls (via Clock
) to the thread’s .seconds
… which isn’t a physical time (seconds
is also settable in Thread
).
So how can I get a an elapsedBeats
that doesn’t depend on when the (current) thread clock has started, e.g to have a shared physical time measure between several threads without having to stick them on the same TempoClock?
I see that I can probably call Main
/Process
's elapsedTime
or monotonicClockTime
none of which are actually documented… (Main
just inherits these methods from Process
). The C++ implementations of these two do
double elapsedTime() { return DurToFloat(std::chrono::high_resolution_clock::now() - hrTimeOfInitialization); }
double monotonicClockTime() { return DurToFloat(monotonic_clock::now().time_since_epoch()); }
I also see that monotonicClockTime
, although it seems to work, is never used in the class library, whereas Main.elapsedTime
is used a bunch of times. Perhaps most notably, it is the source of timestamps used when sending bundles to the server.