fsautoproc
Basic file transformation automation management utility
Loading...
Searching...
No Matches
tm.h File Reference

Time utility functions. More...

#include <stdint.h>
Include dependency graph for tm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  sleepdur_t { DUR_QUEUE = 100 , DUR_WAIT = 250 , DUR_HALT = 500 }
 Predefined sleep durations in milliseconds for various polling cases. More...

Functions

uint64_t tmnow (void)
 Get the current system time in milliseconds.
void tmsleep (uint32_t ms)
 Sleep for the specified number of milliseconds.

Detailed Description

Time utility functions.

Enumeration Type Documentation

◆ sleepdur_t

enum sleepdur_t

Predefined sleep durations in milliseconds for various polling cases.

Enumerator
DUR_QUEUE 

Poll rate when queueing new work to the thread pool.

DUR_WAIT 

Poll rate when waiting for all thread pool work to finish.

DUR_HALT 

Poll rate when waiting for thread pool shutdown.

Function Documentation

◆ tmnow()

uint64_t tmnow ( void )

Get the current system time in milliseconds.

Returns
current time in milliseconds
Here is the caller graph for this function:

◆ tmsleep()

void tmsleep ( uint32_t ms)

Sleep for the specified number of milliseconds.

Note
This function will block the calling thread. The sleep duration may be longer than the specified time due to system scheduling. The function may fail internally via the underlying system call. This will be indicated by a log message, but the function will not return an error code.
Parameters
msThe number of milliseconds to sleep. Must be greater than 0.
Here is the caller graph for this function: