40#ifndef GEOGRAM_BASIC_STOPWATCH
41#define GEOGRAM_BASIC_STOPWATCH
118#if defined(GEO_OS_WINDOWS)
120#elif defined(GEO_OS_EMSCRIPTEN)
157 return now() - start_;
188 Stopwatch(
const std::string& task_name,
bool verbose=
true) :
189 task_name_(task_name), verbose_(verbose) {
198 return W_.elapsed_user_time();
209 Logger::out(task_name_)
210 <<
"Elapsed time: " << W_.elapsed_user_time()
211 <<
" s" << std::endl;
218 std::string task_name_;
Common include file, providing basic definitions. Should be included before anything else by all head...
A more precise stopwatch.
Numeric::uint64 elapsed_time() const
Get the elapsed time.
static Numeric::uint64 now()
ProcessorStopwatch()
ProcessorStopwatch constructor.
Scope restricted stopwatch.
~Stopwatch()
Stopwatch destructor.
double elapsed_time() const
Get the user elapsed time.
Stopwatch(const std::string &task_name, bool verbose=true)
Stopwatch constructor.
Measures the time taken by an algorithm.
void print_elapsed_time(std::ostream &os) const
Prints elapsed time to a stream.
double elapsed_user_time() const
Get the user elapsed time.
SystemStopwatch()
SystemStopwatch constructor.
Generic logging mechanism.
Global Vorpaline namespace.
Types and functions for numbers manipulation.