libfossil
fsl_timer Struct Reference

State for the fsl_timer_xxx() family of functions. More...

#include "util.h"

Collaboration diagram for fsl_timer:

Data Fields

uint64_t system
 The amount of time (microseconds) spent in "kernel space".
uint64_t user
 The amount of time (microseconds) spent in "user space".
uint64_t wall
 The microseconds of "wall clock" time.

Detailed Description

State for the fsl_timer_xxx() family of functions.

Achtung: timer support is only enabled if the library is built with the proper clock support. Windows builds mostly support it automatically (all except wall clock time) and non-Windows builds do if the library is built with HAVE_CLOCK_GETTIME (for clock_gettime(2)) and HAVE_GETRUSAGE (for getrusage(2)) both set to true values. That said: the library currently assumes that non-Windows builds have both of those POSIX-2008 functions. On Windows, building with HAVE_CLOCK_GETTIME is necessary only for fsl_timer::wall.

Example usage:

fsl_timer tRun;
... do some work ...
fsl_timer_add(&tRun, &tTotal);
State for the fsl_timer_xxx() family of functions.
Definition util.h:5447
FSL_EXPORT const fsl_timer fsl_timer_empty
Initialized-with-defaults fsl_timer instance, intended for non-const copy initialization.
Definition util.h:5477
FSL_EXPORT void fsl_timer_start(fsl_timer *t)
Sets t's counter state to the current CPU timer usage, as determined by the OS.

After that, tTotal contains the microseconds of time which elapsed between the time tRun was started and the time fsl_timer_add() was called.

See also
fsl_timer_start()
fsl_timer_fetch()
fsl_timer_add()
fsl_timer_stop()

Definition at line 5447 of file util.h.

Field Documentation

◆ system

uint64_t fsl_timer::system

The amount of time (microseconds) spent in "kernel space".

Definition at line 5456 of file util.h.

◆ user

uint64_t fsl_timer::user

The amount of time (microseconds) spent in "user space".

Definition at line 5451 of file util.h.

◆ wall

uint64_t fsl_timer::wall

The microseconds of "wall clock" time.

Only available if built with HAVE_CLOCK_GETTIME. (Patches for a Windows alternative would be welcomed.)

Definition at line 5463 of file util.h.


The documentation for this struct was generated from the following file: