FastPolyEval  1.0
Fast Evaluation of Real and Complex Polynomials
Macros | Typedefs | Functions
chrono.h File Reference

Tools for precise time measuring. More...

Go to the source code of this file.

Macros

#define BILLION   1000000000L
 One billion (nanoseconds in one second).
 
#define MILLION   1000000L
 One billion (miliseconds in one second).
 
#define MINUTE   60000L
 Miliseconds in one minute.
 
#define HOUR   (60 * MINUTE)
 Miliseconds in one hour.
 
#define DAY   (24 * HOUR)
 Miliseconds in one day.
 
#define USED_CLOCK   CLOCK_MONOTONIC
 The ID of the system clock to use.
 

Typedefs

typedef struct timespec ptime
 Short type name for precise time.
 

Functions

void millis (long ms, char *str)
 Formats the time duration in miliseconds ms into human readable string str. More...
 
void nanos (long ns, char *str)
 Formats the time duration in nanoseconds ns into human readable string str. More...
 
ulong lap (ptime *ts, char *str)
 Computes and prints the time lapse since ts. More...
 
void print_time_res (void)
 Prints the timer resolution.
 

Detailed Description

Tools for precise time measuring.

Definition in file chrono.h.

Function Documentation

◆ lap()

ulong lap ( ptime ts,
char *  str 
)

Computes and prints the time lapse since ts.

Pretty prints the elapsed time into the string str and updates ts to the current time. Does not fail if str==NULL, can also be used as a starter for the chronometer.

Warning
The string str should be at least 90 bytes long.
Parameters
tsold time stamp
strhuman readable string for the time increment
Returns
the total time in nanos

◆ millis()

void millis ( long  ms,
char *  str 
)

Formats the time duration in miliseconds ms into human readable string str.

Warning
The string str should be at least 90 bytes long.
Parameters
msthe time lapse in miliseconds
strthe human readable print

◆ nanos()

void nanos ( long  ns,
char *  str 
)

Formats the time duration in nanoseconds ns into human readable string str.

Warning
The string str should be at least 90 bytes long.
Parameters
nsthe time lapse in miliseconds
strthe human readable print