41#ifndef _CHOMP_SYSTEM_TIMEUSED_H_
42#define _CHOMP_SYSTEM_TIMEUSED_H_
72 timeused (std::ostream &out,
const char *msg = NULL);
102 void show (std::ostream &out,
const char *
message = NULL)
const;
164 out << msg <<
' ' << *
this <<
'.' << std::endl;
173 if ((
display > 0) || (
double (*
this) > 1))
This class defines an output stream for replacing the standard 'cout'.
A class that stores the time at which it was initialized and then returns or displays the time used s...
friend std::ostream & operator<<(std::ostream &out, const timeused &t)
Shows the time elapsed up to this point.
timeused & reset()
Reset the timer to the current moment.
int display
Should the destructor display the time? Note: -1 makes the destructor display times only > 1 sec.
timeused(const char *msg=NULL)
The default constructor.
timeused & operator=(std::ostream &out)
Defines an output stream for displaying program's running time at program's termination.
std::ostream * outstream2
Output stream 2 (0 for no output).
void show(std::ostream &out, const char *message=NULL) const
Shows the time used from the beginning up to the current point.
double cpu0
CPU usage start time (in seconds).
std::time_t t0
Start time (in seconds).
~timeused()
The destructor.
std::ostream * outstream1
Output stream 1 (0 for no output).
const char * message
A message to display instead of "Used time" (if not 0).
This file contains some precompiler definitions which indicate the operating system and/or compiler u...
timeused program_time
The external variable which measures the time used by the program from its start.
This namespace contains the entire CHomP library interface.