summaryrefslogtreecommitdiffstats
path: root/src/shared/timing.c
blob: 4ca1002f72bb8dc69f93bbda4eccd003dfc04e4e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "timing.h"
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

struct timespec basetime;

void timing_abort()
{
	printf( "Cannot get CLOCK_MONOTONIC(_RAW), errno=%d\n", errno );
	exit( 1 );
}

void timing_setBase()
{
	if ( clock_gettime( BEST_CLOCK_SOURCE, &basetime ) == -1 ) {
		memset( &basetime, 0, sizeof(basetime) );
	}
}