mitsuba-af602c6fd98a/src/libcore/timer.cpp
/// Return the resolution of the native time measure expressed in nanoseconds/tick
Return the resolution of the native time measure expressed in nanoseconds/tick
Return the resolution of the native time measure expressed in nanoseconds / tick
static double timerResolution() {
		#if defined(__WINDOWS__)
		    LARGE_INTEGER freq;
		    if (!QueryPerformanceFrequency(&freq))
				SLog(EError, "Could not query the high performance counter: %s",
					lastErrorText().c_str());
			return 1.0 / static_cast<double>(freq.QuadPart) * 1e9;
		#elif defined(__OSX__)
		    mach_timebase_info_data_t info;
		    mach_timebase_info(&info);
			return (double) info.numer / (double) info.denom;
		#else
			return 1.0;
		#endif
	}
static double timerResolution ( ) { #if defined ( __WINDOWS__ ) LARGE_INTEGER freq ; if ( ! QueryPerformanceFrequency ( & freq ) ) SLog ( EError , " " , lastErrorText ( ) . c_str ( ) ) ; return 1.0 / static_cast < double > ( freq . QuadPart ) * 1e9 ; #elif defined ( __OSX__ ) mach_timebase_info_data_t info ; mach_timebase_info ( & info ) ; return ( double ) info . numer / ( double ) info . denom ; #else return 1.0 ; #endif }
Return the resolution of the native time measure expressed in nanoseconds/tick
Return the resolution of the native time measure expressed in nanoseconds / tick