4#ifndef TIMER_USE_STD_CLOCK
6#include <sys/resource.h>
53#ifdef TIMER_USE_STD_CLOCK
54 cstart = std::clock();
66#ifdef TIMER_USE_STD_CLOCK
67 return (std::clock()-cstart) /
static_cast<double>(
CLOCKS_PER_SEC);
72 return 1.0 * (
ru.ru_utime.tv_sec - cstart.tv_sec) + (
ru.ru_utime.tv_usec - cstart.tv_usec) / (1000.0 * 1000.0);
77#ifdef TIMER_USE_STD_CLOCK
Class with mathematical matrix operations.
Definition densematrix.hh:33
Default exception class for OS errors.
Definition exceptions.hh:139
Exception thrown by the Timer class
Definition timer.hh:26
A simple stop watch.
Definition timer.hh:42
double elapsed() const
Get elapsed user-time in seconds.
Definition timer.hh:64
Timer()
A new timer, start immediately.
Definition timer.hh:45
void reset()
Reset timer.
Definition timer.hh:51
A few common exception classes.
#define HDNUM_THROW(E, m)
Definition exceptions.hh:86