sys_now() should work for NO_SYS, too (where sys_init() is not called)

This commit is contained in:
Simon Goldschmidt 2011-10-18 20:14:05 +02:00
parent bdcf5c1ef9
commit 7b92f34341
1 changed files with 5 additions and 0 deletions

View File

@ -56,6 +56,11 @@ static LONGLONG sys_get_ms_longlong()
{
LONGLONG ret;
LARGE_INTEGER now;
#if NO_SYS
if (freq.QuadPart == 0) {
sys_init_timing();
}
#endif /* NO_SYS */
QueryPerformanceCounter(&now);
ret = now.QuadPart-sys_start_time.QuadPart;
return (u32_t)(((ret)*1000)/freq.QuadPart);