#include <tsci2.h>
int tsci2_gettimeofday(struct timeval *tp, tsci2_context context);
tsci2_gettimeofday() set the tp argument with the precisely interpolated time based on argument context. If context is set to NULL, tsci2 library uses the default internal context.
The following code shows how to use tsci2_gettimeofday().
#include <stdio.h>
#include <tsci2.h>
#include <time.h>
int main(int argc, char **argv) {
int preferred_methods, method;
struct timeval tv;
preferred_methods = TSCI2_DAEMON | TSCI2_FALLBACK;
method = tsci2_init(preferred_methods);
if ( method == TSCI2_ERROR )
printf("Error initializing tsci2 library!\n");
if ( tsci2_gettimeofday(&tv, NULL) == TSCI2_ERROR )
printf("Error getting tsci2 time!\n");
tsci2_shutdown();
}