Exemplo n.º 1
0
void Clock::refresh()
{
    time_t systime = getCurrentSystemTime();
    time_t time_incr = (time_t) ((systime - last_refresh_sys_) * ratio_);
    now_ += time_incr;
    last_refresh_sys_ = systime;
}
Exemplo n.º 2
0
// Start the timer
inline void Timer::start() {
    if (!mIsRunning) {

        // Get the current system time
        mLastUpdateTime = getCurrentSystemTime();

        mAccumulator = 0.0;
        mIsRunning = true;
    }
}
Exemplo n.º 3
0
void XabslEngineExecutor::init(InputSource& input)
{
  	if (pEngine != 0) delete pEngine;
  
  	errorHandler.errorsOccurred = false; // reset the error handler
  
  	unsigned long startTime = getCurrentSystemTime();
  
  	pEngine = new Engine(errorHandler,&getCurrentSystemTime);
  
  	registerSymbolsAndBasicBehaviors();
  
  	pEngine->createOptionGraph(input);

  	if (!errorHandler.errorsOccurred)
  	{
    		errorHandler.message("created a new Engine (%li ms)", 
      		getCurrentSystemTime() - startTime );
  	}
}
Exemplo n.º 4
0
// Compute the time since the last update() call and add it to the accumulator
inline void Timer::update() {

    // Get the current system time
    long double currentTime = getCurrentSystemTime();

    // Compute the delta display time between two display frames
    mDeltaTime = currentTime - mLastUpdateTime;

    // Update the current display time
    mLastUpdateTime = currentTime;

    // Update the accumulator value
    mAccumulator += mDeltaTime;
}
Exemplo n.º 5
0
time_t Clock::getUTime()
{
	return getCurrentSystemTime();
}
Exemplo n.º 6
0
void Clock::setNow(time_t now)
{
    now_ = now;
    time_t systime = getCurrentSystemTime();
    last_refresh_sys_ = systime;
}
Exemplo n.º 7
0
Clock::Clock(void) : ratio_(1.0f)
{
    last_refresh_sys_ = getCurrentSystemTime();
    now_ = last_refresh_sys_;
}