JWS C Library
C language utility library
|
Utility functions to track process time. More...
#include <jwsc/config.h>
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <sys/times.h>
Go to the source code of this file.
Data Structures | |
struct | Timer |
Timer structure. More... | |
Functions | |
void | start_timer (Timer *t) |
Starts the timer by initializing it to the current process time. | |
void | stop_timer (Timer *t) |
Stops the timer by differencing a started timer with the current process time. | |
void | add_time_to_timer (Timer *t_1, const Timer *t_2) |
Adds time from one timer to another. | |
void | zero_timer (Timer *t) |
Initializes a timer to zero. | |
user_time | |
Returns the user time of a Timer. | |
double | user_time_s (const Timer *t) |
Returns the user time in seconds. | |
double | user_time_ms (const Timer *t) |
Returns the user time in milliseconds. | |
sys_time | |
Returns the system time of a Timer. | |
double | sys_time_s (const Timer *t) |
Returns the system time of a Timer in seconds. | |
double | sys_time_ms (const Timer *t) |
Returns the system time of a Timer in milliseconds. | |
proc_user_time | |
Returns the current ellapsed process user time. | |
double | proc_user_time_s () |
Returns the current ellapsed process user time in seconds. | |
double | proc_user_time_ms () |
Returns the current ellapsed process user time in milliseconds. | |
proc_sys_time | |
Returns the current ellapsed process system time. | |
double | proc_sys_time_s () |
Returns the current ellapsed process system time in seconds. | |
double | proc_sys_time_ms () |
Returns the system time of a Timer in milliseconds. |
Utility functions to track process time.
Definition in file time.h.
void start_timer | ( | Timer * | t | ) |
void stop_timer | ( | Timer * | t | ) |
void zero_timer | ( | Timer * | t | ) |
double user_time_s | ( | const Timer * | t | ) |
double user_time_ms | ( | const Timer * | t | ) |
double sys_time_s | ( | const Timer * | t | ) |
double sys_time_ms | ( | const Timer * | t | ) |
double proc_user_time_s | ( | ) |
double proc_user_time_ms | ( | ) |
double proc_sys_time_s | ( | ) |