Mercurial > mplayer.hg
comparison osdep/timer-darwin.c @ 26550:8a26190978a6
Force to uint64_t first to avoid direct conversion from double to unsigned int.
author | ulion |
---|---|
date | Mon, 28 Apr 2008 15:57:31 +0000 |
parents | 531116b7693d |
children | 503c2fd0c88b |
comparison
equal
deleted
inserted
replaced
26549:3cce5bfc52c0 | 26550:8a26190978a6 |
---|---|
52 | 52 |
53 | 53 |
54 /* current time in microseconds */ | 54 /* current time in microseconds */ |
55 unsigned int GetTimer() | 55 unsigned int GetTimer() |
56 { | 56 { |
57 return (unsigned int)((mach_absolute_time() * timebase_ratio - startup_time) | 57 return (unsigned int)(uint64_t)((mach_absolute_time() * timebase_ratio - startup_time) * 1e6); |
58 * 1e6); | |
59 } | 58 } |
60 | 59 |
61 /* current time in milliseconds */ | 60 /* current time in milliseconds */ |
62 unsigned int GetTimerMS() | 61 unsigned int GetTimerMS() |
63 { | 62 { |
64 return (unsigned int)((mach_absolute_time() * timebase_ratio - startup_time) | 63 return (unsigned int)(uint64_t)((mach_absolute_time() * timebase_ratio - startup_time) * 1e3); |
65 * 1e3); | |
66 } | 64 } |
67 | 65 |
68 /* time spent between now and last call in seconds */ | 66 /* time spent between now and last call in seconds */ |
69 float GetRelativeTime() | 67 float GetRelativeTime() |
70 { | 68 { |