Show How Much Time Has Passed

◀ Conversion Between char* and string▶ Pause For Some Time
Amazon Sometimes you would like to know how long a program runs. In this situation, you can certainly use the following code to achieve this purpose.
#include<ctime>  /* or <time.h> */

clock_t start = clock(); 		
/* then the program runs... */
.
.
.
/* program ends here; now output how much time the program has run */
cout << (float)(clock() - start) / CLOCKS_PER_SEC << " seconds\n";
◀ Conversion Between char* and string▶ Pause For Some Time

fShare
Questions? Let me know!