add util files

master
Gerolf Ziegenhain 6 years ago
parent 8622552f86
commit 5dad7c3f64
  1. 13
      src/irmc.c
  2. 13
      src/util.c
  3. 1
      src/util.h

@ -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;

@ -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;
}

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

Loading…
Cancel
Save