Go to the documentation of this file.
37 #include "config/use_posix_clock.hh"
47 ::clock_gettime(monotonic ? CLOCK_MONOTONIC : CLOCK_REALTIME, &_time);
50 ::gettimeofday(&tv, NULL);
74 time_t sec = this->sec();
79 ctime_r(&sec, buf,
sizeof(buf));
87 struct tm *tm = localtime(&sec);
88 strftime(buf,
sizeof(buf),
format.c_str(), tm);
95 double time = double(*
this);
96 double secs = fmod(time, 60.0);
97 double all_mins = floor(time / 60.0);
98 double mins = fmod(all_mins, 60.0);
99 double hours = floor(all_mins / 60.0);
115 if (secs < 10.0 && !str.str().empty())
146 clock_nanosleep(CLOCK_MONOTONIC, 0, &
ts, NULL);
148 nanosleep(&
ts, NULL);
156 char *
tz = getenv(
"TZ");
163 fatal(
"Failed to reserve memory for UTC time conversion\n");
170 time_t ret = mktime(time);
#define fatal(...)
This implements a cprintf based fatal() function.
void setTick(Tick ticks)
Set the current time from a value measured in Ticks.
time_t mkutctime(struct tm *time)
uint64_t Tick
Tick count type.
std::string date(const std::string &format="") const
void _set(bool monotonic)
Internal time set function.
void paramOut(CheckpointOut &cp, const string &name, ExtMachInst const &machInst)
Tick Frequency
The simulated frequency of curTick(). (In ticks per second)
void sleep(const Time &time)
void unserialize(const std::string &base, CheckpointIn &cp)
Tick getTick() const
Get the current time from a value measured in Ticks.
void serialize(const std::string &base, CheckpointOut &cp) const
Overload hash function for BasicBlockRange type.
void paramIn(CheckpointIn &cp, const string &name, ExtMachInst &machInst)
std::ostream CheckpointOut
Bitfield< 31, 29 > format
Generated on Wed Sep 30 2020 14:02:08 for gem5 by doxygen 1.8.17