|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Windriver Timing the fast loops, Timer.h?
Is it okay to use the timer class in windriver for quick times. I am trying to get the time between the fast loops, but I am not sure how to achieve this. I see in the IterativeRobot.cpp that they implement a timer, maybe instead of creating my own I can get something from that one. This is how I had first though of using it with its own timer (it would start in the constructor):
Code:
void Robot::AutonomousContinuous()
{
Timer->Stop();
m_class.Process(Timer->Get());
Timer->Reset();
Timer->Start();
}
|
|
#2
|
|||
|
|||
|
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();
}
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Axis Camera responding in the Vision Assistant but not in WindRiver | DanDon | C/C++ | 3 | 11-01-2009 12:50 |
| timer in the robot controler | MaCaBi | Programming | 2 | 06-02-2006 13:55 |
| We geared this one really fast, so fast it caught on fire! | Travis Covington | Robot Showcase | 18 | 12-02-2005 07:22 |
| How fast is fast to get on the hill? | ianbbat | General Forum | 76 | 09-03-2003 21:05 |
| Solution to Timing Loops | Steven Carmain | Programming | 39 | 10-02-2003 13:33 |