Table of Contents

Name

The tsci2 library provided substitution function for system gettimeofday().

Synopsis

#include <tsci2.h>

int tsci2_gettimeofday(struct timeval *tp, tsci2_context context);

Description

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.

Return Values

Upon successful completion, tsci2_gettimeofday() returns 0. Otherwise, TSCI2_ERROR is returned.

Examples

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();

}

Author

Xun Luo (sherwoodluo@users.sourceforge.net)

See Also

tsci2d(8) , tsci2demo(1) , tsci2_measure(1) , tsci2_init(3) , tsci2_shutdown(3) , tsci2_alloc_context(3) , tsci2_free_context(3) , tsci2_get_default_context(3) , tsci2_getticks(3) , tsci2_ticks2timeval(3) .


Table of Contents