示例#1
0
static void print_event_timestamp(const event & evt)
{
  const time_t & evt_time = evt.get_time();

  char time_format_buffer[TIME_FORMAT_BUFF_SIZE];
  struct tm * tm_time = uflag ? gmtime(&evt_time) : localtime(&evt_time);

  string date =
    strftime(time_format_buffer,
             TIME_FORMAT_BUFF_SIZE,
             tformat.c_str(),
             tm_time) ? string(time_format_buffer) : string(_("<date format error>"));

  cout << date;
}
示例#2
0
文件: Simulation.cpp 项目: ma1t05/SQM
void insert_event(list_events &events,event &x) {
  list_events::iterator it = events.begin(),end = events.end();
  while (it != end && x.get_time() > (*it)->get_time()) it++;
  events.insert(it,&x);
}