add util files

This commit is contained in:
Gerolf Ziegenhain 2016-10-04 18:34:50 +02:00
parent 8622552f86
commit 5dad7c3f64
3 changed files with 14 additions and 13 deletions

View File

@ -45,19 +45,6 @@ char last_sender[16];
/* settings */
int translate = 1;
int audio_status = 1;
/* a better clock() in milliseconds */
long fastclock(void)
{
struct timespec t;
long r;
current_utc_time (&t);
r = t.tv_sec * 1000;
r = r + t.tv_nsec / 1000000;
return r;
}
int kbhit (void)
{
struct timeval tv;

View File

@ -17,3 +17,16 @@ void current_utc_time(struct timespec *ts) {
}
/* a better clock() in milliseconds */
long fastclock(void)
{
struct timespec t;
long r;
current_utc_time (&t);
r = t.tv_sec * 1000;
r = r + t.tv_nsec / 1000000;
return r;
}

View File

@ -9,4 +9,5 @@
void current_utc_time(struct timespec *ts);
long fastclock(void);