User Tools

Site Tools


for_developers:timing_measurement

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
for_developers:timing_measurement [2016/10/24 07:56] – [Explanation of the implementation] graffor_developers:timing_measurement [2016/11/29 09:47] – [How the timer works] graf
Line 1: Line 1:
-====== Using built in timer for measuring real time performance ======+====== Using Periodic Counter to measure Realtime Performance ======
  
 ===== How the timer works ===== ===== How the timer works =====
Line 8: Line 8:
 Of these three measurements the minimal value, maximal value, mean value and the variance are calculated. Of these three measurements the minimal value, maximal value, mean value and the variance are calculated.
  
-Implementation in //Execurot.cpp//:+Implementation in //Executor.cpp//:
 <code cpp> <code cpp>
 ... ...
Line 53: Line 53:
 eeros::Executor::instance().add(per); eeros::Executor::instance().add(per);
 </code> </code>
- 
  
 If the executor has a small cycle time (less than 1 second) it is not advisable to update the log output each time. In the example the output is only updated after 1000 cycles. Depending on the cycle time, this number can be adjusted.\\ If the executor has a small cycle time (less than 1 second) it is not advisable to update the log output each time. In the example the output is only updated after 1000 cycles. Depending on the cycle time, this number can be adjusted.\\
 +Every periodic includes a periodic counter object. In case you simply define a time domain and add it to the executor its corresponding periodic object is created internally and you cannot access its periodic counter object. In such cases you manually create a periodic object and pass its time domain as a parameter.   
 +<code cpp> 
 +eeros::control::TimeDomain td1("td1",0.01, true);  // periodic counter not accessible 
 +eeros::Executor::instance().add(td1); 
 +eeros::control::TimeDomain td2("td1",0.01, true);   
 +eeros::task::Periodic per2("per2",0.01, td2);  // now you can add monitor functions to its counter 
 +eeros::Executor::instance().add(per2); 
 +</code>
  
 Line 7 defines which date should be written to the terminal output. Following options are available for //run// time and //period// time: Line 7 defines which date should be written to the terminal output. Following options are available for //run// time and //period// time: