summaryrefslogblamecommitdiffstats
path: root/src/shared/timing.c
blob: bdb838868ca116973abc3a3e23765c80775f67e2 (plain) (tree)
1
                                



















                                                                        
#include <dnbd3/shared/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) );
	}
}