26 August 2018 10:36:50 AM 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 2e-06 1e-06 1e-06 0 1e-06 0 1e-06 2e-06 2 0 0 1e-06 1e-06 0 0 4e-07 1e-06 4 1e-06 0 0 1e-06 0 0 4e-07 1e-06 8 1e-06 0 0 1e-06 1e-06 0 6e-07 1e-06 16 1e-06 0 1e-06 0 0 0 4e-07 1e-06 32 0 1e-06 0 1e-06 0 0 4e-07 1e-06 64 1e-06 1e-06 1e-06 1e-06 1e-06 1e-06 1e-06 1e-06 128 1e-06 2e-06 2e-06 1e-06 2e-06 1e-06 1.6e-06 2e-06 256 3e-06 2e-06 3e-06 2e-06 3e-06 2e-06 2.6e-06 3e-06 512 5e-06 4e-06 4e-06 5e-06 4e-06 4e-06 4.4e-06 5e-06 1024 9e-06 8e-06 9e-06 8e-06 9e-06 8e-06 8.6e-06 9e-06 2048 1.6e-05 1.7e-05 1.7e-05 1.6e-05 1.6e-05 1.6e-05 1.64e-05 1.7e-05 4096 3.3e-05 3.2e-05 3.2e-05 3.3e-05 3.3e-05 3.2e-05 3.26e-05 3.3e-05 8192 6.7e-05 6.4e-05 6.3e-05 6.5e-05 6.4e-05 6.3e-05 6.46e-05 6.7e-05 16384 0.000134 0.000126 0.000127 0.000126 0.000126 0.000126 0.0001278 0.000134 32768 0.000279 0.000244 0.000244 0.000243 0.000268 0.000243 0.0002556 0.000279 65536 0.000582 0.000505 0.000487 0.000487 0.000488 0.000487 0.0005098 0.000582 131072 0.00112 0.000981 0.000976 0.000975 0.000976 0.000975 0.0010056 0.00112 262144 0.002228 0.00195 0.001974 0.001947 0.001951 0.001947 0.00201 0.002228 524288 0.004453 0.003902 0.00371 0.003504 0.003507 0.003504 0.0038152 0.004453 1048576 0.008062 0.006901 0.006981 0.006981 0.006901 0.006901 0.0071652 0.008062 2097152 0.01612 0.014047 0.013882 0.013926 0.013954 0.013882 0.0143858 0.01612 4194304 0.03196 0.027991 0.02786 0.027782 0.027882 0.027782 0.028695 0.03196 8388608 0.063837 0.055633 0.055881 0.055518 0.055813 0.055518 0.0573364 0.063837 16777216 0.12884 0.111128 0.111233 0.11216 0.11562 0.111128 0.115796 0.12884 TIMER_CLOCK Normal end of execution. 26 August 2018 10:36:51 AM