Cycle throughput calculation

Is it possible to determine the bandwidth of the application on the processor from the cycles (cycles of processor instructions) consumed by the application? If so, how to calculate it?

+3
source share
4 answers

If the process is completely CPU-related, then you divide the processor speed by the number of cycles to get throughput.

In fact, several processes are completely CPU related, in which case you must consider other factors (disk speed, memory speed, serialization, etc.).

+2
source

Plain:

#include <time.h>
clock_t c;
c = clock(); // c holds clock ticks value
c = c / CLOCKS_PER_SEC; // real time, if you need it

, , . clock() .

+2

, , ( ), , / / .. , , , , . , .

0

If you are using Cortex-M3 from TI / Luminary Micro, you can use the driverlib provided by TI / Luminary Micro. Using the SysTick functions, you can set the SysTickPeriod processor cycle to 1: Thus, you have 1 processor cycle between interrupts. By counting the number of interrupts, you should get an “almost sufficient estimate” of how long a function or function block takes.

0
source

Source: https://habr.com/ru/post/1750555/


All Articles