diff --git a/stepmania/src/arch/ArchHooks/ArchHooks.h b/stepmania/src/arch/ArchHooks/ArchHooks.h index 4e7554bc34..12ed6f4a4d 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks.h +++ b/stepmania/src/arch/ArchHooks/ArchHooks.h @@ -23,8 +23,23 @@ public: virtual void SetTime( tm newtime ) { } - /* */ - virtual int64_t GetMicrosecondsSinceStart() = 0; + /* + * Return the amount of time since the program started. (This may actually be + * since the initialization of HOOKS. + * + * Full microsecond accuracy may not be available. + * + * bAccurate is a hint: it specifies whether to prefer short-term precision + * or long-term accuracy. If false, the implementation may give higher resolution + * results, but not be as stable over long periods (eg. may drift depending on + * clock speed shifts on laptops). If true, lower precision results (usually with + * no less than a 1ms granularity) are returned, but the results should be stable + * over long periods of time. + * + * Note that bAccurate may change the result significantly; it may use a different + * timer, and may have a different concept of when the program "started". + */ + virtual int64_t GetMicrosecondsSinceStart( bool bAccurate ) = 0; }; ArchHooks *MakeArchHooks(); diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp b/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp index adbd4188c4..6dcd9c91ed 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp +++ b/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp @@ -185,7 +185,7 @@ void ArchHooks_Win32::SetTime( tm newtime ) SetLocalTime( &st ); } -int64_t ArchHooks_Win32::GetMicrosecondsSinceStart() +int64_t ArchHooks_Win32::GetMicrosecondsSinceStart( bool bAccurate ) { static bool bInitialized; static DWORD iStartTime; diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_Win32.h b/stepmania/src/arch/ArchHooks/ArchHooks_Win32.h index 3d72256aa7..cc21ee1ff1 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_Win32.h +++ b/stepmania/src/arch/ArchHooks/ArchHooks_Win32.h @@ -17,7 +17,7 @@ public: void EnterTimeCriticalSection(); void ExitTimeCriticalSection(); void SetTime( tm newtime ); - int64_t GetMicrosecondsSinceStart(); + int64_t GetMicrosecondsSinceStart( bool bAccurate ); private: void CheckVideoDriver();