Ensign
Low-rank framework for multi-core CPUs and GPUs
Loading...
Searching...
No Matches
timer.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <string>
9#include <time.h>
10
11#include <generic/common.hpp>
12
13
14namespace Ensign {
15
20struct timer {
21 timespec t_start;
22 bool running;
23 double elapsed;
24 unsigned counter;
25 double elapsed_sq;
26
28
29 void reset();
30 void start();
31 double stop();
32
33 double total();
34 double average();
35 double deviation();
36 unsigned count();
37};
38
40namespace gt {
41
42 bool is_master();
43 void reset();
44 void print();
45
46 std::string sorted_output();
47 void start(std::string name);
48 void stop(std::string name);
49 double total(std::string name);
50 double average(std::string name);
51 double deviation(std::string name);
52
53}
54
55} // namespace Ensign
Provides shared types, platform headers, and basic definitions.
double deviation(std::string name)
double average(std::string name)
void start(std::string name)
bool is_master()
void reset()
std::string sorted_output()
double total(std::string name)
void print()
void stop(std::string name)
Core namespace for Ensign's numerical algorithms and data structures.
Definition common.hpp:96
This timer class measures the elapsed time between two events.
Definition timer.hpp:20
double deviation()
double total()
unsigned count()
timespec t_start
Definition timer.hpp:21
bool running
Definition timer.hpp:22
unsigned counter
Definition timer.hpp:24
double elapsed_sq
Definition timer.hpp:25
double average()
double elapsed
Definition timer.hpp:23
double stop()