Nilorea Library
C utilities for networking, threading, graphics
TIMERS: generally used headers, defines, timers, allocators,...

Data Structures

struct  N_TIME
 Timing Structure. More...
 

Functions

time_t get_msec (N_TIME *timer)
 Poll any N_TIME HiTimer, returning msec, and moving currentTime to startTime. More...
 
time_t get_sec (N_TIME *timer)
 Poll any N_TIME HiTimer, returning sec, and moving currentTime to startTime. More...
 
time_t get_usec (N_TIME *timer)
 Poll any N_TIME HiTimer, returning usec, and moving currentTime to startTime. More...
 
void PAUSE (void)
 make a pause in a terminal More...
 
int start_HiTimer (N_TIME *timer)
 Initialize or restart from zero any N_TIME HiTimer. More...
 
void u_sleep (unsigned int usec)
 wrapper around usleep for API consistency More...
 

Detailed Description


Data Structure Documentation

◆ N_TIME

struct N_TIME

Timing Structure.

Examples
ex_fluid.c.

Definition at line 33 of file n_time.h.

+ Collaboration diagram for N_TIME:
Data Fields
struct timeval currentTime start time
time_t delta time since last poll
struct timeval startTime start time

Function Documentation

◆ get_msec()

time_t get_msec ( N_TIME timer)

Poll any N_TIME HiTimer, returning msec, and moving currentTime to startTime.

Parameters
timerAny N_TIMER *timer you wanna poll
Returns
The elapsed number of msec for the given N_TIME *timer

Definition at line 130 of file n_time.c.

◆ get_sec()

time_t get_sec ( N_TIME timer)

Poll any N_TIME HiTimer, returning sec, and moving currentTime to startTime.

Parameters
timerAny N_TIMER *timer you wanna poll
Returns
The elapsed number of sec for the given N_TIME *timer

Definition at line 153 of file n_time.c.

◆ get_usec()

time_t get_usec ( N_TIME timer)

Poll any N_TIME HiTimer, returning usec, and moving currentTime to startTime.

Parameters
timerAny N_TIMER *timer you wanna poll
Returns
The elapsed number of usec for the given N_TIME *timer

Definition at line 107 of file n_time.c.

Referenced by manage_particle(), and n_kafka_pooling_thread().

+ Here is the caller graph for this function:

◆ PAUSE()

void PAUSE ( void  )

make a pause in a terminal

Definition at line 49 of file n_time.c.

References LOG_DEBUG, LOG_ERR, and n_log.

◆ start_HiTimer()

int start_HiTimer ( N_TIME timer)

Initialize or restart from zero any N_TIME HiTimer.

Parameters
timerAny N_TIMER *timer you wanna start or reset
Returns
TRUE or FALSE

Definition at line 82 of file n_time.c.

Referenced by init_particle_system(), and n_kafka_pooling_thread().

+ Here is the caller graph for this function:

◆ u_sleep()

void u_sleep ( unsigned int  usec)

wrapper around usleep for API consistency

Parameters
usecNumber of usec to sleep

Definition at line 38 of file n_time.c.

Referenced by destroy_threaded_pool(), manage_client(), netw_send_func(), netw_wait_msg(), and wait_for_threaded_pool().

+ Here is the caller graph for this function: