Question: Write a C/C++/UNIX procedure, getTime ( ), that returns the execution time of code segments by calling it before the code segment is executed and
Write a C/C++/UNIX procedure, getTime ( ), that returns the execution time of code segments by calling it before the code segment is executed and again after the code segment is executed; for example:
double getTime(int);
start = getTime(-3);
;
stop = getTime(-3);
elapsedTime = Stop - start; // in milliseconds
Use the UNIX kernel gettimeofday( ) call to read the clock on your host system. The parameter specifies the resolution of the time. If the parameter is i, then the length of time for one time unit is 10i’. (i = 2-3 means return the time in milliseconds and i = 2-6 means return the time in microseconds.) State the smallest clock resolution for which your routine operates properly on your host machine.
Step by Step Solution
3.47 Rating (170 Votes )
There are 3 Steps involved in it
Here is the CC Program include include double ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
34-E-CE-OS (392).docx
120 KBs Word File
