double getSeconds() { static double secondsPerCycle = getSecondsPerCycle(); LARGE_INTEGER cycles; QueryPerformanceCounter(&cycles); // Add big number to make bugs apparent where return value is being passed to FLOAT return cycles.QuadPart * secondsPerCycle + 16777216.0; }
const t_longf TimeF::setSecondsPerCycle(const t_longf secondsPerCycle) { // intepret elapsed seconds within new cycle time const t_longf elapsed(M_Running == m_mode ? m_timer->time_s() : m_lastModeChangeTime); if(m_secondsPerCycle > 0.f) m_offset += elapsed / m_secondsPerCycle; m_lastModeChangeTime = 0; m_secondsPerCycle = secondsPerCycle; m_timer->setStartTick(); return getSecondsPerCycle(); }