+ 2
To print a time taken to execution by function
Using build fuction and corresponding header file
3 Respostas
+ 4
We can use clock() function provided by <time.h> header file to calculate the CPU time consumed by a task within a C application. It returns clock_t type which stores the number of clock ticks.
In order to compute the number of seconds elapsed, we need to divide the number of clock ticks elapsed by CLOCKS_PER_SEC macro (also present in <time.h>)
You can look for examples online.
Hope it helps!
+ 4
This code should not run in sololearn because of missing library files on sololearn's compiler but it will work on turbo c/cpp compiler.
https://code.sololearn.com/csQKGJRWpb4w/?ref=app
+ 2
Thanks