Jetson Inference
DNN Vision Library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules

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...
 
float timeFloat (const timespec &a)
 Convert to 32-bit float (in milliseconds). More...
 
float timeDouble (const timespec &a)
 Convert to 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

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

float timeDouble ( const timespec &  a)
inline

Convert to 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.