for_developers:timing_measurement
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
for_developers:timing_measurement [2016/07/27 13:32] – gehrig | for_developers:timing_measurement [2018/04/18 22:05] (current) – removed graf | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Using built in timer for measuring real time performance ====== | ||
- | |||
- | ===== How the timer works ===== | ||
- | The timer function is included in the Executer object. It measures the time each start of a cycle (// | ||
- | |||
- | |||
- | ===== Implementation ===== | ||
- | To integrate the measurement, | ||
- | < | ||
- | using namespace eeros:: | ||
- | |||
- | |||
- | |||
- | eeros:: | ||
- | |||
- | td.monitors.push_back([](eeros:: | ||
- | static int ticks = 0; | ||
- | if (++ticks < 1000) return; | ||
- | // if (++ticks < 10) return; | ||
- | ticks = 0; | ||
- | eeros:: | ||
- | c.reset(); | ||
- | log.trace() << " | ||
- | << counter.jitter.max*1000 << " | ||
- | << counter.run.max*1000; | ||
- | }); | ||
- | |||
- | eeros:: | ||
- | </ | ||
- | |||
- | |||
- | ==== Explanation of the implementation ==== | ||
- | 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 implementation of the code example the output is only updated after 1000 cycles. Depending on the cycle time, this number can be adjusted in line 3. | ||
- | |||
- | Line 7 defines which date should be written to the terminal output. Following options are available for //run// time and //period// time: | ||
- | * min | ||
- | * max | ||
- | * mean | ||
- | * variance | ||
- | The time is measured in nanoseconds. | ||
- | |||
- | |||
- | ===== Save terminal output on a host computer via SSH ===== | ||
- | Because of memory restriction or because writing a file would affect the real time behavior of the system it is maybe not possible to save the output of the terminal directly on the target system. The output can be saved on a different computer with following command: | ||
- | < | ||
- | With this command it is possible to measure for multiple hours or even multiple days. | ||
- | |||
for_developers/timing_measurement.1469619147.txt.gz · Last modified: 2016/07/27 13:32 (external edit)