94 friend std::ostream&
operator<<(std::ostream& os,
const StopWatch& sw);
96 StopWatch() {time(&
first);
notify(
"StopWatch constructor.");}
97 ~StopWatch() {
notify(
"StopWatch destructor.");}
106 return difftime(current,
first);
110 std::ostream&
print(std::ostream& os)
const
114 int days=dif/(60*60*24); dif%=60*60*24;
115 int hours=dif/(60*60); dif%=60*60;
116 int minutes=dif/60; dif%=60;
118 os <<
"StopWatch time: "<< days <<
":";
119 if(hours<10) os <<
"0";
121 if(minutes<10) os <<
"0";
122 os << minutes <<
":";
123 if(seconds<10) os <<
"0";
124 os << seconds <<
" (equals " << dif2 <<
" seconds)";
135inline std::ostream&
operator<<(std::ostream& os,
const StopWatch& sw) {
friend std::ostream & operator<<(std::ostream &os, const StopWatch &sw)
Streams a StopWatch's print() (formatted elapsed time) to os.
Definition stopwatch.hpp:135
double time_elapsed() const
Returns the number of whole seconds elapsed since construction (wall-clock via time(),...
Definition stopwatch.hpp:99
std::mutex timeelapsed_mutex
serializes concurrent time_elapsed() calls on one StopWatch (FST_THREADED only); first itself is writ...
Definition stopwatch.hpp:130
time_t first
wall-clock time captured at construction, the time_elapsed() baseline
Definition stopwatch.hpp:128
std::ostream & print(std::ostream &os) const
Writes elapsed time formatted as "StopWatch time: D:HH:MM:SS (equals N seconds)" to os.
Definition stopwatch.hpp:110
FST4 specific error passing class.
The Feature Selection Toolbox 4 library: every library component – data access, criteria and classifi...
Definition data_accessor.hpp:80
void notify(const std::string msg)
Prints msg followed by a newline via syncout::print(); a no-op unless the preprocessor macro DEBUG is...
Definition global.hpp:112
std::ostream & operator<<(std::ostream &os, const Data_Intervaller< CONTAINER, IDXTYPE > &ia)
Streams every contained interval as "si:<startidx>, c:<count>" lines to os.
Definition data_intervaller.hpp:152