say for some reason I wanted a program to read from the clock before it started a task then when it was done read from the system clock again and see how long it took. How do I read from a clock in C++? Is it in #include<time.h>? If it is a function included in some standard library can someone please modify my following example code so it outputs the time it took to run through a simple for loop.
//Here it reads from clock and stores time in a varible
for (int i = 0; i < 100; i++) {
cout << i << endl;
}
//And now it reads from the clock again and finds the difference from current time and first recorded time and outputs it to tell the user.
Please fill in the comments with real code if you know how to retrieve time from the computer in C/++ or if you know of a website that has this kind of information a link is worth 1,000 posted replys.
//Here it reads from clock and stores time in a varible
for (int i = 0; i < 100; i++) {
cout << i << endl;
}
//And now it reads from the clock again and finds the difference from current time and first recorded time and outputs it to tell the user.
Please fill in the comments with real code if you know how to retrieve time from the computer in C/++ or if you know of a website that has this kind of information a link is worth 1,000 posted replys.