Commit 5a4f55d7 authored by Jack Moffitt's avatar Jack Moffitt

Change long long to the more standard uint64_t. This will need to be

typedefed for some platforms.

svn path=/trunk/timing/; revision=2190
parent 5c1e9632
......@@ -3,6 +3,7 @@
*/
#include <stdlib.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
......@@ -16,7 +17,7 @@
/*
* Returns milliseconds no matter what.
*/
long long timing_get_time(void)
uint64_t timing_get_time(void)
{
#ifdef _WIN32
return timeGetTime();
......@@ -25,16 +26,16 @@ long long timing_get_time(void)
gettimeofday(&mtv, NULL);
return (long long)(mtv.tv_sec) * 1000 + (long long)(mtv.tv_usec) / 1000;
return (uint64_t)(mtv.tv_sec) * 1000 + (uint64_t)(mtv.tv_usec) / 1000;
#endif
}
void timing_sleep(long long sleeptime)
void timing_sleep(uint64_t sleeptime)
{
struct timeval sleeper;
sleeper.tv_sec = 0;
sleeper.tv_usec = sleeptime * 1000;
select(0, NULL, NULL, NULL, &sleeper);
select(1, NULL, NULL, NULL, &sleeper);
}
#ifndef __TIMING_H__
#define __TIMING_H__
long long timing_get_time(void);
void timing_sleep(long long sleeptime);
#include <stdint.h>
uint64_t timing_get_time(void);
void timing_sleep(uint64_t sleeptime);
#endif /* __TIMING_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment