My Project
programmer's documentation
|
#include "cs_config.h"
#include "cs_defs.h"
#include <math.h>
#include <time.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
#include "cs_timer.h"
Macros | |
#define | _POSIX_C_SOURCE 200112L |
Functions | |
double | cs_timer_wtime (void) |
Return Wall clock time. More... | |
double | cs_timer_cpu_time (void) |
Return CPU time. More... | |
void | cs_timer_cpu_times (double *user_time, double *system_time) |
Return separate user and system CPU times. More... | |
cs_timer_t | cs_timer_time (void) |
Return a timer's value. More... | |
cs_timer_counter_t | cs_timer_diff (const cs_timer_t *t0, const cs_timer_t *t1) |
Compute the difference between 2 timers. More... | |
const char * | cs_timer_wtime_method (void) |
Return method used to return wall clock time. More... | |
const char * | cs_timer_cpu_time_method (void) |
Return method used to return CPU time. More... | |
#define _POSIX_C_SOURCE 200112L |
double cs_timer_cpu_time | ( | void | ) |
Return CPU time.
Note that in the rare case that only the minimal C library clock() method is available (see cs_timer_cpu_time_method()), at least one of the cs_timer_...() functions (possibly this one) must be called upon program start for this function to be used. In addition, in this case, time may "loop" back to 0 every multiple of 2^size_t / CLOCKS_PER_SEC seconds.
const char* cs_timer_cpu_time_method | ( | void | ) |
Return method used to return CPU time.
void cs_timer_cpu_times | ( | double * | user_time, |
double * | system_time | ||
) |
Return separate user and system CPU times.
Note that in the rare case that only the minimal C library clock() method is available, this function will return -1 values.
[out] | user_time | current user CPU usage. |
[out] | system_time | current system CPU usage. |
cs_timer_counter_t cs_timer_diff | ( | const cs_timer_t * | t0, |
const cs_timer_t * | t1 | ||
) |
Compute the difference between 2 timers.
[in] | t0 | oldest timer value |
[in] | t1 | most recent timer value |
cs_timer_t cs_timer_time | ( | void | ) |
Return a timer's value.
double cs_timer_wtime | ( | void | ) |
Return Wall clock time.
const char* cs_timer_wtime_method | ( | void | ) |
Return method used to return wall clock time.