# HG changeset patch # User ulion # Date 1193097968 0 # Node ID c10db72e1afc2af0ab726ba4591750f23bcd1e76 # Parent 1903b15e6fb740c4cdff6a44d76ecc58ee0cf6f5 Fix GetTimerMS() discontinuous return value bug caused by GetTimer() overflow on darwin. This bug will cause osd stuck on darwin. diff -r 1903b15e6fb7 -r c10db72e1afc osdep/timer-darwin.c --- a/osdep/timer-darwin.c Mon Oct 22 22:42:47 2007 +0000 +++ b/osdep/timer-darwin.c Tue Oct 23 00:06:08 2007 +0000 @@ -61,7 +61,8 @@ /* current time in milliseconds */ unsigned int GetTimerMS() { - return (unsigned int)(GetTimer() / 1000); + return (unsigned int)((mach_absolute_time() * timebase_ratio - startup_time) + * 1e3); } /* time spent between now and last call in seconds */