add util files
This commit is contained in:
parent
8622552f86
commit
5dad7c3f64
13
src/irmc.c
13
src/irmc.c
@ -45,19 +45,6 @@ char last_sender[16];
|
|||||||
/* settings */
|
/* settings */
|
||||||
int translate = 1;
|
int translate = 1;
|
||||||
int audio_status = 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)
|
int kbhit (void)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
13
src/util.c
13
src/util.c
@ -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);
|
void current_utc_time(struct timespec *ts);
|
||||||
|
long fastclock(void);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user