- May
- 13,123
- 180
This snippet looks pretty good. TIMER reports reasonable numbers.
But when I use the shortened version of the TIMER command, I get unreasonable numbers; they're all too small, especially the one after a 5 second timeout.
Code:
v:\> do forever ( timer & echo %@ping[www.syr.edu,5] & timer )
Timer 1 on: 13:16:46
83
Timer 1 off: 13:16:46 Elapsed: 0:00:00.09
Timer 1 on: 13:16:46
85
Timer 1 off: 13:16:46 Elapsed: 0:00:00.08
Timer 1 on: 13:16:46
84
Timer 1 off: 13:16:46 Elapsed: 0:00:00.10
Timer 1 on: 13:16:46
-1
Timer 1 off: 13:16:51 Elapsed: 0:00:05.00
Timer 1 on: 13:16:51
83
Timer 1 off: 13:16:52 Elapsed: 0:00:00.08
Code:
do forever ( timer echo %@ping[www.syr.edu,5] )
Timer 1 on: 13:17:30
86
Timer 1 off: 13:17:30 Elapsed: 0:00:00.01
Timer 1 on: 13:17:30
85
Timer 1 off: 13:17:30 Elapsed: 0:00:00.00
Timer 1 on: 13:17:35
-1
Timer 1 off: 13:17:35 Elapsed: 0:00:00.00 <== I watched it wait for 5 seconds
Timer 1 on: 13:17:35
84
Timer 1 off: 13:17:35 Elapsed: 0:00:00.00