parallel-cellular-automata
Framework for building parallel cellular automata.
utimer.hpp
Go to the documentation of this file.
1 
8 #ifndef PARALLEL_CELLULAR_AUTOMATA_UTIMER_HPP
9 #define PARALLEL_CELLULAR_AUTOMATA_UTIMER_HPP
10 
11 #include <chrono>
12 #include <string>
13 
19 class UTimer
20 {
21  std::chrono::system_clock::time_point start;
22  std::chrono::system_clock::time_point stop;
23  std::string message;
24  using usecs = std::chrono::microseconds;
25  using msecs = std::chrono::milliseconds;
26 
27  protected:
28  long *us_elapsed;
29 
30  public:
37  UTimer(const std::string m);
46  UTimer(const std::string m, long *us);
51  ~UTimer();
52 };
53 
54 #endif
RAII Timer that prints on cout the time elapsed since its creation and a message. The time is measure...
Definition: utimer.hpp:20
UTimer(const std::string m)
Construct a new UTimer object.
Definition: utimer.cpp:16
~UTimer()
Destroy the UTimer object and print the message containing the elapsed time.
Definition: utimer.cpp:26