If pressed enter then it will get halted with the required value as shown in the output. It takes some time for execution and allocates resources as per the operating system. \n", time_consumed) Ĭlock() function in C here is used for demonstrating the flow where func_1 consumes the flow of time with the execution of some value and its time as well. Printf("func_1() took %f seconds for execution of some value. \n") ĭouble time_consumed = ((double)t_0)/CLOCKS_PER_SEC Printf("Press enter_button to stop func_1 when entered. This program demonstrates how the time is consumed by the function for its processing as shown in the output below. Here are the following examples mentioned below. If error the function, in turn, returns -1.The clock function return is the amount of elapsed time for processing since the program gets started at the beginning of any program.Once the work comes to end the clock() function result will be assigned to the end() function further giving the manipulation of CPU timings on a per-second basis for start and end at the time of resource allocation.It will then perform all work for manipulation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |