aboutsummaryrefslogtreecommitdiffhomepage
path: root/osdep
diff options
context:
space:
mode:
authorGravatar Uoti Urpala <uau@glyph.nonexistent.invalid>2009-05-08 23:50:26 +0300
committerGravatar Uoti Urpala <uau@glyph.nonexistent.invalid>2009-05-08 23:50:26 +0300
commit1db1773ec27fc4e7c9d44ad02ccfa7eaf364ce07 (patch)
treec5e99bfe0e69cd37fb8ac70fadf00ce54a1cbe3c /osdep
parentf2864e9a072f53c38a04dd7c44392521777dc908 (diff)
parent86c9fb2e8930de031807513c9b93d47394d2d2fa (diff)
Merge svn changes up to r29277
Diffstat (limited to 'osdep')
-rw-r--r--osdep/timer-darwin.c6
-rw-r--r--osdep/timer-linux.c13
2 files changed, 11 insertions, 8 deletions
diff --git a/osdep/timer-darwin.c b/osdep/timer-darwin.c
index 64edfe7ef6..a6e5a987d1 100644
--- a/osdep/timer-darwin.c
+++ b/osdep/timer-darwin.c
@@ -51,19 +51,19 @@ int usec_sleep(int usec_delay)
/* current time in microseconds */
-unsigned int GetTimer()
+unsigned int GetTimer(void)
{
return (unsigned int)(uint64_t)(mach_absolute_time() * timebase_ratio * 1e6);
}
/* current time in milliseconds */
-unsigned int GetTimerMS()
+unsigned int GetTimerMS(void)
{
return (unsigned int)(uint64_t)(mach_absolute_time() * timebase_ratio * 1e3);
}
/* initialize timer, must be called at least once at start */
-void InitTimer()
+void InitTimer(void)
{
struct mach_timebase_info timebase;
diff --git a/osdep/timer-linux.c b/osdep/timer-linux.c
index 576bae5be6..defb69ff7b 100644
--- a/osdep/timer-linux.c
+++ b/osdep/timer-linux.c
@@ -31,9 +31,9 @@
const char timer_name[] =
#ifdef HAVE_NANOSLEEP
- "nanosleep()";
+ "nanosleep()";
#else
- "usleep()";
+ "usleep()";
#endif
int usec_sleep(int usec_delay)
@@ -49,19 +49,22 @@ int usec_sleep(int usec_delay)
}
// Returns current time in microseconds
-unsigned int GetTimer(void){
+unsigned int GetTimer(void)
+{
struct timeval tv;
gettimeofday(&tv,NULL);
return tv.tv_sec * 1000000 + tv.tv_usec;
}
// Returns current time in milliseconds
-unsigned int GetTimerMS(void){
+unsigned int GetTimerMS(void)
+{
struct timeval tv;
gettimeofday(&tv,NULL);
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}
// Initialize timer, must be called at least once at start
-void InitTimer(void){
+void InitTimer(void)
+{
}