{
int exit_status = 0; // global exit status
double simulated_time = -1.0;
- timestamp elapsed_time(timestamp::wallclock_time);
- timestamp simulation_time(timestamp::cpu_time);
+ timestamp elapsed_time(timestamp::clock_type::WALLCLOCK);
+ timestamp simulation_time(timestamp::clock_type::CPU);
msg_error_t res;
elapsed_time.start();
class timestamp {
public:
- enum clock_type { wallclock_time, cpu_time };
+ enum class clock_type { WALLCLOCK, CPU };
timestamp(clock_type ct);
~timestamp();
void timestamp::get_time(struct timespec& tv)
{
switch (clk) {
- case cpu_time: {
+ case clock_type::CPU: {
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tv);
break;
}
- case wallclock_time:
+ case clock_type::WALLCLOCK:
#ifdef CLOCK_MONOTONIC_RAW
clock_gettime(CLOCK_MONOTONIC_RAW, &tv);
#else