16 May 2017 09:15:14 PM TIMER_CLOCK C++ version Demonstrate the use of the CLOCK timer. CLOCK is a C++ library routine (defined in ) It returns the processor time used by the program since the beginning of program execution. Divide this by CLOCKS_PER_SEC to convert to seconds. CLOCK is a crude timer, and results less than a tenth of a second are probably not reliable. The number of clock ticks per second is 1000000 TEST01 Time the RAND function by computing N values. For a given N, repeat the computation 5 times. Data vectors will be of minimum size 1 Data vectors will be of maximum size 16777216 CPU times are in seconds. N Rep #1 Rep #2 Rep #2 Rep #4 Rep #5 Min Ave Max 1 5e-06 0 0 1e-06 0 0 1.2e-06 5e-06 2 2e-06 0 1e-06 0 0 0 6e-07 2e-06 4 0 0 0 0 0 0 0 0 8 0 1e-06 0 1e-06 0 0 4e-07 1e-06 16 0 0 0 0 0 0 0 0 32 1e-06 1e-06 1e-06 0 1e-06 0 8e-07 1e-06 64 0 2e-06 1e-06 1e-06 1e-06 0 1e-06 2e-06 128 1e-06 1e-06 1e-06 2e-06 1e-06 1e-06 1.2e-06 2e-06 256 4e-06 2e-06 2e-06 2e-06 2e-06 2e-06 2.4e-06 4e-06 512 3e-06 4e-06 3e-06 4e-06 3e-06 3e-06 3.4e-06 4e-06 1024 9e-06 7e-06 6e-06 7e-06 7e-06 6e-06 7.2e-06 9e-06 2048 1.7e-05 1.4e-05 1.4e-05 1.3e-05 1.4e-05 1.3e-05 1.44e-05 1.7e-05 4096 3.3e-05 2.7e-05 2.7e-05 2.7e-05 2.7e-05 2.7e-05 2.82e-05 3.3e-05 8192 6.7e-05 5.3e-05 5.3e-05 5.3e-05 5.4e-05 5.3e-05 5.6e-05 6.7e-05 16384 0.000131 0.000108 0.000107 0.000107 0.000107 0.000107 0.000112 0.000131 32768 0.000259 0.000213 0.000215 0.000214 0.000215 0.000213 0.0002232 0.000259 65536 0.000516 0.000428 0.000427 0.00047 0.000493 0.000427 0.0004668 0.000516 131072 0.001067 0.000854 0.000854 0.000854 0.000853 0.000853 0.0008964 0.001067 262144 0.002035 0.001707 0.001707 0.001707 0.001708 0.001707 0.0017728 0.002035 524288 0.004139 0.003413 0.003412 0.003416 0.00348 0.003412 0.003572 0.004139 1048576 0.008318 0.006876 0.006827 0.006852 0.007463 0.006827 0.0072672 0.008318 2097152 0.01899 0.013942 0.013909 0.013792 0.013813 0.013792 0.0148892 0.01899 4194304 0.034121 0.027348 0.027656 0.027944 0.028186 0.027348 0.029051 0.034121 8388608 0.066301 0.060033 0.054888 0.054829 0.059572 0.054829 0.0591246 0.066301 16777216 0.133287 0.10999 0.111058 0.110484 0.117674 0.10999 0.116499 0.133287 TIMER_CLOCK Normal end of execution. 16 May 2017 09:15:15 PM