nanosecond resolution in progress
This commit is contained in:
parent
c0c9d637a4
commit
de90eaffdd
1 changed files with 10 additions and 2 deletions
12
src/main.c
12
src/main.c
|
@ -1,6 +1,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "config.h"
|
||||
|
@ -8,10 +10,16 @@
|
|||
#include "gui.h"
|
||||
#include "display.h"
|
||||
|
||||
static long long time_in_useconds( void )
|
||||
{
|
||||
struct timespec ts;
|
||||
timespec_get( &ts, TIME_UTC );
|
||||
return ( long long )ts.tv_sec * 1000000000 + ts.tv_nsec;
|
||||
}
|
||||
|
||||
long long time_in_mseconds( void )
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
gettimeofday( &tv, NULL );
|
||||
return ( ( ( long long )tv.tv_sec ) * 1000 ) + ( tv.tv_usec / 1000 );
|
||||
}
|
||||
|
@ -20,7 +28,7 @@ long long currentTime;
|
|||
|
||||
// gui_update
|
||||
long long lastTime_gui_update = 0;
|
||||
long long delay_gui_update = 16;
|
||||
long long delay_gui_update = 16; // 15625;
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue