Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how to calculate execution time in c for different instruction

0 votes
asked Apr 18, 2019 by ommi

2 Answers

0 votes
answered Aug 28, 2019 by anonymous
#include <stdio.h>
#include <time.h>

int main(){

clock_t begin, end; //declaration of variables to store clock ticks elapsed

double time_taken;  //variable to store how long taken

begin = clock(); //start the clock

//execute some commands

end = clock(); //stop the clock

time_taken = (double)(end-begin) / CLOCKS_PER_SEC;  //work out how long dividing by number of clock ticks per second

printf("Time taken: %f", time_taken);

return 0;

}
0 votes
answered Aug 30, 2019 by anonymous
what is my name?
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...