Thank you for your help.
I have a question regarding firmware development using nrf52840.
Currently, we are trying to measure the time required to process a function in order to quantitatively evaluate the processing load.
As a method, I am using the function time() included in time.h.
The specific code is simple and looks like the following, which obtains the start time and end time and outputs the difference in milliseconds.
However, the output does not display the value part. When the end time is output as a test, it is displayed as "nan," so this may be the cause of the problem.
Is there any way to address this issue?
I am using Segger Embedded Studio 5.50a for debugging.
Thank you in advance.
#include <stdio.h> #include <time.h> int main(void){ time_t start_time, end_time; double elapsed_time; start_time = time(NULL); (Processing content) end_time = time(NULL); elapsed_time = difftime(end_time, start_time); printf("time=%.6f[s]\n", elapsed_time); }