1. TimerLoop Demos
There are several demonstrations provided with TimerLoop. To use them type the given command to a Cedar Commander. See TimerLoopImpl to see how they are implemented.
TimeArithmetic
Evaluates a number of expressions such as, x ← 2*x, or x ← RealFns.SqRt[x] and prints out the time taken by each in a human-readable format to the Commander typescript.
Sample Statistics
Here are some results I got on my SPARC-2 on December 9, 1992:
% TimeArithmetic
All times in microseconds. Spending at least 1 second on each test.
x ← 3: 0.27 avg, 10.15 worst avg over 516 calls, 764 trials (init: 0.52 avg)
x ← x+1: 0.97 avg, 135.02 worst avg over 455 calls, 514 trials (init: 0.67 avg)
x←x+1; x←x+1: 1.75 avg, 143.94 worst avg over 428 calls, 453 trials (init: 0.68 avg)
x ← x*2: 1.00 avg, 18.33 worst avg over 457 calls, 459 trials (init: 0.70 avg)
x ← RealFns.SqRt[x]: 5.34 avg, 194.40 worst avg over 322 calls, 315 trials (init: 0.72 avg)
n ← 3: 0.34 avg, 17.66 worst avg over 508 calls, 708 trials (init: 0.52 avg)
n ← n+1: 0.28 avg, 10.64 worst avg over 496 calls, 641 trials (init: 0.63 avg)
n ← n*2: 0.27 avg, 6.12 worst avg over 493 calls, 474 trials (init: 0.64 avg)
% TimeIO
All times in microseconds. Spending at least 3 seconds on each test.
GetCedarTokenRope: 149.95 avg, 5819.42 worst avg over 19 calls, 340 trials (init: 5.79 avg)
GetCedarToken: 80.96 avg, 1326.78 worst avg over 49 calls, 522 trials (init: 3.94 avg)
SkipWhitespace: 37.74 avg, 718.97 worst avg over 91 calls, 469 trials (init: 3.37 avg)
There are a few disturbing results here. Floating point assignment appears faster than natural number assignment. x←x+1; x←x+1 does not take twice as long as x ← x+1 (although it is not far off).
These results also point out that GetCedarTokenRope, GetCedarToken, and SkipWhitespace are all painfully slow.