diff options
Diffstat (limited to 'source/blender/blenlib/intern/time.c')
-rw-r--r-- | source/blender/blenlib/intern/time.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/blenlib/intern/time.c b/source/blender/blenlib/intern/time.c index 2f53aa38e77..64f007513ed 100644 --- a/source/blender/blenlib/intern/time.c +++ b/source/blender/blenlib/intern/time.c @@ -37,35 +37,35 @@ double PIL_check_seconds_timer(void) { - static int hasperfcounter= -1; /* -1==unknown */ + static int hasperfcounter = -1; /* -1==unknown */ static double perffreq; - if (hasperfcounter==-1) { + if (hasperfcounter == -1) { __int64 ifreq; - hasperfcounter= QueryPerformanceFrequency((LARGE_INTEGER*) &ifreq); - perffreq= (double) ifreq; + hasperfcounter = QueryPerformanceFrequency((LARGE_INTEGER *) &ifreq); + perffreq = (double) ifreq; } if (hasperfcounter) { __int64 count; - QueryPerformanceCounter((LARGE_INTEGER*) &count); + QueryPerformanceCounter((LARGE_INTEGER *) &count); - return count/perffreq; + return count / perffreq; } else { - static double accum= 0.0; - static int ltick= 0; - int ntick= GetTickCount(); + static double accum = 0.0; + static int ltick = 0; + int ntick = GetTickCount(); - if (ntick<ltick) { - accum+= (0xFFFFFFFF-ltick+ntick)/1000.0; + if (ntick < ltick) { + accum += (0xFFFFFFFF - ltick + ntick) / 1000.0; } else { - accum+= (ntick-ltick)/1000.0; + accum += (ntick - ltick) / 1000.0; } - ltick= ntick; + ltick = ntick; return accum; } } @@ -87,17 +87,17 @@ double PIL_check_seconds_timer(void) gettimeofday(&tv, &tz); - return ((double) tv.tv_sec + tv.tv_usec/1000000.0); + return ((double) tv.tv_sec + tv.tv_usec / 1000000.0); } void PIL_sleep_ms(int ms) { - if (ms>=1000) { - sleep(ms/1000); - ms= (ms%1000); + if (ms >= 1000) { + sleep(ms / 1000); + ms = (ms % 1000); } - usleep(ms*1000); + usleep(ms * 1000); } #endif |