Jetson Inference
DNN Vision Library

Timestamping operations for measuring the timing of CPU code. More...

Functions

void timestamp (timespec *timestampOut)
 Retrieve a timestamp of the current system time. More...
 
timespec timestamp ()
 Retrieve a timestamp of the current system time. More...
 
timespec timeZero ()
 Return a blank timespec that's been zero'd. More...
 
timespec timeNew (time_t seconds, long int nanoseconds)
 Return an initialized timespec More...
 
timespec timeNew (long int nanoseconds)
 Return an initialized timespec More...
 
timespec timeAdd (const timespec &a, const timespec &b)
 Add two times together. More...
 
void timeDiff (const timespec &start, const timespec &end, timespec *result)
 Find the difference between two timestamps. More...
 
timespec timeDiff (const timespec &start, const timespec &end)
 Find the difference between two timestamps. More...
 
int timeCmp (const timespec &a, const timespec &b)
 Compare two timestamps. More...
 
void apptime (timespec *a)
 Retrieve the elapsed time since the process started. More...
 
float apptime ()
 Retrieve the elapsed time since the process started (in seconds). More...
 
float timeFloat (const timespec &a)
 Convert to 32-bit float (in milliseconds). More...
 
double timeDouble (const timespec &a)
 Convert to 64-bit double (in milliseconds). More...
 
double timeDouble ()
 Get current timestamp as 64-bit double (in milliseconds). More...
 
char * timeStr (const timespec &timestamp, char *strOut)
 Produce a text representation of the timestamp. More...
 
void timePrint (const timespec &timestamp, const char *text=NULL)
 Print the time to stdout. More...
 
void sleepTime (const timespec &duration)
 Put the current thread to sleep for a specified time. More...
 
void sleepTime (time_t seconds, long int nanoseconds)
 Put the current thread to sleep for a specified time. More...
 
void sleepMs (uint64_t milliseconds)
 Put the current thread to sleep for a specified number of milliseconds. More...
 
void sleepUs (uint64_t microseconds)
 Put the current thread to sleep for a specified number of microseconds. More...
 
void sleepNs (uint64_t nanoseconds)
 Put the current thread to sleep for a specified number of nanoseconds. More...
 

Detailed Description

Timestamping operations for measuring the timing of CPU code.

Function Documentation

◆ apptime() [1/2]

void apptime ( timespec *  a)
inline

Retrieve the elapsed time since the process started.

◆ apptime() [2/2]

float apptime ( )
inline

Retrieve the elapsed time since the process started (in seconds).

◆ sleepMs()

void sleepMs ( uint64_t  milliseconds)
inline

Put the current thread to sleep for a specified number of milliseconds.

◆ sleepNs()

void sleepNs ( uint64_t  nanoseconds)
inline

Put the current thread to sleep for a specified number of nanoseconds.

◆ sleepTime() [1/2]

void sleepTime ( const timespec &  duration)
inline

Put the current thread to sleep for a specified time.

◆ sleepTime() [2/2]

void sleepTime ( time_t  seconds,
long int  nanoseconds 
)
inline

Put the current thread to sleep for a specified time.

◆ sleepUs()

void sleepUs ( uint64_t  microseconds)
inline

Put the current thread to sleep for a specified number of microseconds.

◆ timeAdd()

timespec timeAdd ( const timespec &  a,
const timespec &  b 
)
inline

Add two times together.

◆ timeCmp()

int timeCmp ( const timespec &  a,
const timespec &  b 
)
inline

Compare two timestamps.

Returns
0, if timestamp A equals timestamp B >0, if timestamp A is greater than timestamp B <0, if timestamp A is less than timestamp B

◆ timeDiff() [1/2]

void timeDiff ( const timespec &  start,
const timespec &  end,
timespec *  result 
)
inline

Find the difference between two timestamps.

◆ timeDiff() [2/2]

timespec timeDiff ( const timespec &  start,
const timespec &  end 
)
inline

Find the difference between two timestamps.

◆ timeDouble() [1/2]

double timeDouble ( const timespec &  a)
inline

Convert to 64-bit double (in milliseconds).

◆ timeDouble() [2/2]

double timeDouble ( )
inline

Get current timestamp as 64-bit double (in milliseconds).

◆ timeFloat()

float timeFloat ( const timespec &  a)
inline

Convert to 32-bit float (in milliseconds).

◆ timeNew() [1/2]

timespec timeNew ( time_t  seconds,
long int  nanoseconds 
)
inline

Return an initialized timespec

◆ timeNew() [2/2]

timespec timeNew ( long int  nanoseconds)
inline

Return an initialized timespec

◆ timePrint()

void timePrint ( const timespec &  timestamp,
const char *  text = NULL 
)
inline

Print the time to stdout.

◆ timestamp() [1/2]

void timestamp ( timespec *  timestampOut)
inline

Retrieve a timestamp of the current system time.

◆ timestamp() [2/2]

timespec timestamp ( )
inline

Retrieve a timestamp of the current system time.

◆ timeStr()

char* timeStr ( const timespec &  timestamp,
char *  strOut 
)
inline

Produce a text representation of the timestamp.

◆ timeZero()

timespec timeZero ( )
inline

Return a blank timespec that's been zero'd.