OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [gold/] [timer.cc] - Diff between revs 27 and 163

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 27 Rev 163
Line 47... Line 47...
Timer::start()
Timer::start()
{
{
  this->get_time(&this->start_time_);
  this->get_time(&this->start_time_);
}
}
 
 
 
// Record the time used by pass N (0 <= N <= 2).
 
void
 
Timer::stamp(int n)
 
{
 
  gold_assert(n >= 0 && n <= 2);
 
  TimeStats& thispass = this->pass_times_[n];
 
  this->get_time(&thispass);
 
}
 
 
#if HAVE_SYSCONF && defined _SC_CLK_TCK
#if HAVE_SYSCONF && defined _SC_CLK_TCK
# define TICKS_PER_SECOND sysconf (_SC_CLK_TCK) /* POSIX 1003.1-1996 */
# define TICKS_PER_SECOND sysconf (_SC_CLK_TCK) /* POSIX 1003.1-1996 */
#else
#else
# ifdef CLK_TCK
# ifdef CLK_TCK
#  define TICKS_PER_SECOND CLK_TCK /* POSIX 1003.1-1988; obsolescent */
#  define TICKS_PER_SECOND CLK_TCK /* POSIX 1003.1-1988; obsolescent */
Line 104... Line 113...
  delta.user = now.user - this->start_time_.user;
  delta.user = now.user - this->start_time_.user;
  delta.sys = now.sys - this->start_time_.sys;
  delta.sys = now.sys - this->start_time_.sys;
  return delta;
  return delta;
}
}
 
 
 
// Return the stats for pass N (0 <= N <= 2).
 
Timer::TimeStats
 
Timer::get_pass_time(int n)
 
{
 
  gold_assert(n >= 0 && n <= 2);
 
  TimeStats thispass = this->pass_times_[n];
 
  TimeStats& lastpass = n > 0 ? this->pass_times_[n-1] : this->start_time_;
 
  thispass.wall -= lastpass.wall;
 
  thispass.user -= lastpass.user;
 
  thispass.sys -= lastpass.sys;
 
  return thispass;
 
}
 
 
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.