Resets the initial reference time.
| 80 | |
| 81 | /// Resets the initial reference time. |
| 82 | void b3Clock::reset(bool zeroReference) |
| 83 | { |
| 84 | if (zeroReference) |
| 85 | { |
| 86 | #ifdef B3_USE_WINDOWS_TIMERS |
| 87 | m_data->mStartTime.QuadPart = 0; |
| 88 | #else |
| 89 | #ifdef __CELLOS_LV2__ |
| 90 | m_data->mStartTime = 0; |
| 91 | #else |
| 92 | m_data->mStartTime = (struct timeval){0}; |
| 93 | #endif |
| 94 | #endif |
| 95 | } |
| 96 | else |
| 97 | { |
| 98 | #ifdef B3_USE_WINDOWS_TIMERS |
| 99 | QueryPerformanceCounter(&m_data->mStartTime); |
| 100 | #else |
| 101 | #ifdef __CELLOS_LV2__ |
| 102 | |
| 103 | typedef uint64_t ClockSize; |
| 104 | ClockSize newTime; |
| 105 | //__asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory"); |
| 106 | SYS_TIMEBASE_GET(newTime); |
| 107 | m_data->mStartTime = newTime; |
| 108 | #else |
| 109 | gettimeofday(&m_data->mStartTime, 0); |
| 110 | #endif |
| 111 | #endif |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | /// Returns the time in ms since the last call to reset or since |
| 116 | /// the b3Clock was created. |
no outgoing calls
no test coverage detected