aboutsummaryrefslogtreecommitdiff
path: root/src/clock33.c
blob: c9edfaf5f1e9cbdf2518e32d9c93d3fb7ffb8c57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "sys/time.h"

#include "clock33.h"


Size clock33_get_us( void )
{
  static struct timeval tv;
  gettimeofday( &tv, 0 );
  return (tv.tv_sec * 1000000) + tv.tv_usec;
}

f64 clock33_get_s_hires( void )
{
  static struct timeval tv;
  gettimeofday( &tv, 0 );
  return (f64)((f64)tv.tv_sec + ((f64)tv.tv_usec / 1000000));
}