[OpenR8 solution] Timer (Calculate how long it takes to run a certain process)
  1. Chapter1: Timer introduction


Timer is used to calculate how long it takes to execute a program, such as how long it takes to calculate the page. The method of use is quite simple. As long as you want to calculate the time in the pull-in process, you can know how much time it takes, as shown in Fig. 1.


Fig. 1.Timer process.png

Fig. 1.Timer process.



  1. Chapter2: Timer folder introduction


The Timer is located in the solution folder of OpenR8, as shown in Fig. 2, which has a flow file, such as Fig. 3.


Fig. 2.Timer location.png

Fig. 2.Timer location.


Fig. 3.Timer folder.png

Fig. 3.Timer folder.




  1. Chapter3: Timer.flow — Calculate the time it takes for the function to run


Please double-click “R8_Python3.6_CPU.bat or R8_Python3.6_GPU.bat” => “File” => “Open” => “Enter the solution folder under OpenR8” => “Select Timer folder” => “Load Timer.flow”, as shown in Fig. 4, Fig. 5.


Fig. 4.Select Timer.flow.png

Fig. 4.Select Timer.flow.


Fig. 5.Load Timer.flow.png

Fig. 5.Load Timer.flow.


Press Run to see the time that the [Sleep] function is executed, as shown in Fig. 6. The functional flow is illustrated in Fig. 6.


Fig. 6.Operation result.png

Fig. 6.Operation result.


Fig. 7.Flowchart of Timer.flow.png

Fig. 7.Flowchart of Timer.flow.



  1. Chapter4: Timer function introduction


Fig. 8.Timer function.png

Fig. 8.Timer function.


  1. “Timer_GetMicrosecond”: After [Timer_Stop], the time taken between [Timer_Start] (or [Timer_Reset]) to [Timer_Stop] is obtained.
  2. “Timer_Init”: Be sure to initialize before using the Timer function.
  3. “Timer_Release”: The Timer is released when the Timer function is not used last.
  4. “Timer_Reset”: Re-zeroing starts timing.
  5. “Timer_Start”: Start the timer.
  6. “Timer_Stop”: End the timer.


※For the flow of the Timer function, refer to Fig. 1.

Recommended Article

OpenR8 - AI Software for Everyone (Download)