Bsoft 2.1.4
Bernard's software package
timer.cpp File Reference

Utilities for timing functions. More...

#include <ctime>
#include <sys/time.h>
#include "timer.h"
#include "utilities.h"

Functions

tm * get_localtime ()
 Returns the current local time. More...
 
double getwalltime ()
 Returns the current time. More...
 
double getcputime ()
 Returns the clock time. More...
 
double timer_start ()
 Starts timer and prints the time. More...
 
double timer_report (double lasttime)
 Reports the time elapsed since a given time. More...
 

Variables

int verbose
 

Detailed Description

Utilities for timing functions.

Author
Bernard Heymann
Date
Created: 20010316
Modified: 20221103

Function Documentation

◆ get_localtime()

tm * get_localtime ( )

Returns the current local time.

Returns
tm* the current local time struct.

The time format is in the tm struct.

◆ getcputime()

double getcputime ( )

Returns the clock time.

Returns
double the clock time in seconds.
The time format is in clock seconds since the start of the process.

◆ getwalltime()

double getwalltime ( )

Returns the current time.

Returns
double the current time in seconds.

The time format is in seconds since Jan. 1, 1970, including microseconds.

◆ timer_report()

double timer_report ( double  lasttime)

Reports the time elapsed since a given time.

Parameters
lasttimethe given initial time.
Returns
double the current time.

◆ timer_start()

double timer_start ( )

Starts timer and prints the time.

Returns
double the current time.

Variable Documentation

◆ verbose

int verbose
extern