MCPcopy Create free account
hub / github.com/audacity/audacity / SystemTime

Function SystemTime

libraries/lib-note-track/MIDIPlay.cpp:486–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

484static double streamStartTime = 0; // bias system time to small number
485
486static double SystemTime(bool usingAlsa)
487{
488#ifdef __WXGTK__
489 if (usingAlsa) {
490 struct timespec now;
491 // CLOCK_MONOTONIC_RAW is unaffected by NTP or adj-time
492#if defined(CLOCK_MONOTONIC_RAW)
493 clock_gettime(CLOCK_MONOTONIC_RAW, &now);
494#else
495 clock_gettime(CLOCK_REALTIME, &now);
496#endif
497 //return now.tv_sec + now.tv_nsec * 0.000000001;
498 return (now.tv_sec + now.tv_nsec * 0.000000001) - streamStartTime;
499 }
500#else
501 static_cast<void>(usingAlsa);//compiler food.
502#endif
503
504 return util_GetTime() - streamStartTime;
505}
506
507bool MIDIPlay::mMidiStreamActive = false;
508bool MIDIPlay::mMidiOutputComplete = true;

Callers 3

StartOtherStreamMethod · 0.85
MidiTimeMethod · 0.85
ComputeOtherTimingsMethod · 0.85

Calls 1

util_GetTimeFunction · 0.85

Tested by

no test coverage detected