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.
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.
Fig. 3.Timer folder.
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.
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.
Fig. 7.Flowchart of Timer.flow.
Chapter4: Timer function introduction
Fig. 8.Timer function.
- “Timer_GetMicrosecond”: After [Timer_Stop], the time taken between [Timer_Start] (or [Timer_Reset]) to [Timer_Stop] is obtained.
- “Timer_Init”: Be sure to initialize before using the Timer function.
- “Timer_Release”: The Timer is released when the Timer function is not used last.
- “Timer_Reset”: Re-zeroing starts timing.
- “Timer_Start”: Start the timer.
- “Timer_Stop”: End the timer.
※For the flow of the Timer function, refer to Fig. 1.