View Single Post
  #2   Spotlight this post!  
Unread 09-01-2009, 00:19
Jlulian Jlulian is offline
Registered User
AKA: Julian Moore
FRC #0004
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: CA
Posts: 5
Jlulian is an unknown quantity at this point
Re: Windriver Timing the fast loops, Timer.h?

You could use the timer class, but in the same header as that is defined is the "GetTime()" function, which is used internally in the class, and is simpler to work with.

Using it would look something like this:
Code:
void Robot::AutonomousContinuous()
{
	double timeChange = GetTime() - lastTime
	//Time dependent Code..
	lastTime = GetTime();
}
(this code snippet assumes you've got a lastTime variable in your class)