Example #1
0
// ----------------------------------------------------------------------------
/// HIFN	For the timer passed as parameter returns the elapsed time between the StartTimer() and StopTimer() function calls.
/// HIRET The elapsed time between the StartTimer() and StopTimer() function calls
/// HIPAR timer/double - The timer for wich you wants to get the elapsed time
double GetElapsedTime(HRWatch *timer) {

    LARGE_INTEGER time;

    time.QuadPart = timer->stop.QuadPart - timer->start.QuadPart;
    return LIToSecs(&time) ;
}
Example #2
0
double StopWatch::getElapsedTime() 
{
    LARGE_INTEGER time;
    QueryPerformanceCounter(&currTime) ;
    time.QuadPart = currTime.QuadPart - prevTime.QuadPart;
    prevTime = currTime;
    return LIToSecs( time) ;
}
Example #3
0
  float CStopWatch::Interval( ) {
     LARGE_INTEGER currentTime;
     LARGE_INTEGER time;
	 QueryPerformanceCounter(&currentTime);
     time.QuadPart = currentTime.QuadPart -lastInterval.QuadPart;
	 lastInterval.QuadPart=currentTime.QuadPart;
     return (float)LIToSecs(time) ;
  }
Example #4
0
// -------------------------------------------------------
// finalize profiling frame
// -------------------------------------------------------
void finalize() {
    LARGE_INTEGER EndingTime;
    QueryPerformanceCounter(&EndingTime);
    LARGE_INTEGER time;
    time.QuadPart = EndingTime.QuadPart - ctx.data[0].startingTime.QuadPart;
    float elapsed = LIToSecs(time);
    ctx.totalTime = elapsed;
    ctx.data[0].totalTime = elapsed;
}
Example #5
0
double hrt_elapsed_time(hr_timer_t *hr_timer)
{
#ifdef __WIN32
    LARGE_INTEGER time;
    time.QuadPart = hr_timer->end_tm.QuadPart - hr_timer->start_tm.QuadPart;
    return LIToSecs( &time) ;
#else
    return  ((double)(hr_timer->end_tm.tv_sec - hr_timer->start_tm.tv_sec))+((double)(hr_timer->end_tm.tv_nsec - hr_timer->start_tm.tv_nsec)/1000000000L);
#endif
}
Example #6
0
    double Timer::elapsed() {
#if WIN32
        LARGE_INTEGER timenow;
        QueryPerformanceCounter(&timenow) ;
        LARGE_INTEGER time;
        time.QuadPart = timenow.QuadPart - mTimer.start.QuadPart;
        mLastElapsed = LIToSecs( time) ;
#else
        double now = clock();
        mLastElapsed = subtractTimes(now, mStart);
#endif
        return mLastElapsed;
    }
Example #7
0
    void Timer::stopTimer() {
        mIsRunning = false;
#if WIN32
        QueryPerformanceCounter(&mTimer.stop) ;
        LARGE_INTEGER time;
        time.QuadPart = mTimer.stop.QuadPart - mTimer.start.QuadPart;
        mLastElapsed = LIToSecs( time) ;
#else 
        mStop = clock();
        mLastElapsed = subtractTimes(mStop, mStart);
#endif
        mTotal += mLastElapsed;
    }
Example #8
0
// -------------------------------------------------------
// stop profiling sector
// -------------------------------------------------------
void end(const char* name) {
    int hashName = hash(name);
    int index = find(hashName);
    if (index != -1) {
        LARGE_INTEGER EndingTime;
        QueryPerformanceCounter(&EndingTime);
        LARGE_INTEGER time;
        time.QuadPart = EndingTime.QuadPart - ctx.data[index].startingTime.QuadPart;
        float elapsed = LIToSecs(time);
        ctx.totalTime += elapsed;
        ctx.data[index].totalTime += elapsed;
        //ctx.data[index].invokeCounter += 1;
        ctx.current = ctx.data[index].parent;
    }
}
Example #9
0
void nitro_sleep(uint32 usecs) {
    LARGE_INTEGER time;
    LARGE_INTEGER freq;
    LARGE_INTEGER step;
    LARGE_INTEGER elapsed;
    
    QueryPerformanceFrequency(&freq);
    QueryPerformanceCounter(&time);
    
    do {
        QueryPerformanceCounter(&step);
        elapsed.QuadPart = step.QuadPart - time.QuadPart ;
    } while ( LIToSecs ( elapsed, freq ) * 1000000 < usecs );

}
double CStopWatch::getElapsedTime() {

#ifdef WINDOWS_64
	LARGE_INTEGER time;
	time.QuadPart = watch.stop.QuadPart - watch.start.QuadPart;
	time.HighPart = watch.stop.HighPart - watch.start.HighPart;
	time.LowPart = watch.stop.LowPart - watch.start.LowPart;
	
	return LIToSecs( time) ;
#endif
#ifdef WINDOWS_32
	//printf("32bit clock timer. Maybe uncertain.\n");
	return double(stop-start)/double(CLOCKS_PER_SEC);
#endif

}
Example #11
0
double StopWatch::GetElapsedTime()
{
	LARGE_INTEGER time;
	time.QuadPart = timer.stop.QuadPart - timer.start.QuadPart;
	return 1000 * LIToSecs(time);
}
Example #12
0
float Timer::Interval()
{
	LARGE_INTEGER time;
	time.QuadPart=timer.stop.QuadPart-timer.start.QuadPart;
	return (float)LIToSecs(time);
};
Example #13
0
double CStopWatch::getElapsedTime() {
	LARGE_INTEGER time;
	time.QuadPart = timer.stop.QuadPart - timer.start.QuadPart;
    return LIToSecs( time, frequency) ;
}