예제 #1
0
uint64_t ClockPosix::now()
{
#if defined(HAVE_POSIX_TIMERS)
  struct timespec ts;
#if defined(HAVE_PTHREAD_CONDATTR_SETCLOCK)
  clock_gettime(getClockId(), &ts);
#else
  clock_gettime(CLOCK_REALTIME, &ts);
#endif
  return toNSec(ts);
#else
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return toNSec(tv);
#endif
}
예제 #2
0
파일: Timer.cpp 프로젝트: LancePutnam/Gamma
void sleepSec(double t){
	sleep(toNSec(t));
}