Modules-old/Microstrain/Microstrain.cpp
//! Helper function to get system time in nanoseconds.
Helper function to get system time in nanoseconds.
Helper function to get system time in nanoseconds .
static unsigned long long time_helper()
{
#if POSIX_TIMERS > 0
  struct timespec curtime;
  clock_gettime(CLOCK_REALTIME, &curtime);
  return (unsigned long long)(curtime.tv_sec) * 1000000000 + (unsigned long long)(curtime.tv_nsec);  
#else
  struct timeval timeofday;
  gettimeofday(&timeofday,NULL);
  return (unsigned long long)(timeofday.tv_sec) * 1000000000 + (unsigned long long)(timeofday.tv_usec) * 1000;  
#endif
}
static unsigned long long time_helper ( ) { #if POSIX_TIMERS > 0 struct timespec curtime ; clock_gettime ( CLOCK_REALTIME , & curtime ) ; return ( unsigned long long ) ( curtime . tv_sec ) * 1000000000 + ( unsigned long long ) ( curtime . tv_nsec ) ; #else struct timeval timeofday ; gettimeofday ( & timeofday , NULL ) ; return ( unsigned long long ) ( timeofday . tv_sec ) * 1000000000 + ( unsigned long long ) ( timeofday . tv_usec ) * 1000 ; #endif }
Helper function to get system time in nanoseconds.
Helper function to get system time in nanoseconds .