Module: rtime.cpp

class RTime
.h

constructorRTime()
destructor~RTime()
AddSimTimevoid AddSimTime(int msecs)

Another 'msecs' of time was simulated

Startvoid Start()

Start the real timer

Stopvoid Stop()

Stop the real timer

Updatevoid Update()

Update the real timing



/*
 * RTime
 * 05-10-00: Created!
 * (c) Dolphinity/Ruud van Gaal
 */

#include <racer/racer.h>
#include <qlib/debug.h>
#pragma hdrstop
DEBUG_ENABLE

RTime::RTime()
{
  // Default time span
  span=0.01;
  tmr=new QTimer();
  curRealTime=0;
  curSimTime=0;
}
RTime::~RTime()
{
}

/**********
* Attribs *
**********/
void RTime::AddSimTime(int msecs)
// Another 'msecs' of time was simulated
{
  curSimTime+=msecs;
}

/*************
* Start/stop *
*************/
void RTime::Start()
// Start the real timer
{
  tmr->Start();
}
void RTime::Stop()
// Stop the real timer
{
  tmr->Stop();
}

/*********
* Update *
*********/
void RTime::Update()
// Update the real timing
{
  curRealTime=tmr->GetMilliSeconds();
}