C++ task.
Budget: $10 – $30 CAD
Task
The need arises for one to perform "benchmarking" of code (i.e., time how long something takes to execute). Such is useful enough to place the code to do such inside a function (template) so it can be easily used again later.
main()
The program's main() function has only one function call in it to the benchmark() function you will write later in this assignment. The benchmark() function has a single argument: a lambda function (no arguments, void return) whose body is:
int count = 0;
for (double d; cin >> d; ++count)
;
cout << count << " double values were read in.\n";
The need arises for one to perform "benchmarking" of code (i.e., time how long something takes to execute). Such is useful enough to place the code to do such inside a function (template) so it can be easily used again later.
main()
The program's main() function has only one function call in it to the benchmark() function you will write later in this assignment. The benchmark() function has a single argument: a lambda function (no arguments, void return) whose body is:
int count = 0;
for (double d; cin >> d; ++count)
;
cout << count << " double values were read in.\n";