| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#Y) The Clear or Output Timer command allows the programmer to manually clear Timer 1 or 2, to check the Timer's accumulated value, or to output the current value of Timer 1 or 2 to the output file, preceded by a 'T'. This command is useful for timing operations using Timer 2, to see if there is some unaccounted-for overhead in Cogsys commands.
#Y
#Y[Timer number,Clear or Output or Check]
@C Testing the "timer" function \#Y#W2000 Starting the timing now, and waiting 5 seconds. Press any key after the 'x' appears... #Y[2,0]#W5000x#R$AV20=V5#Y[2,2]$AV21=V5 You waited $SV20 milliseconds to press a key. The Background Timer timed $SV21 milliseconds, including the 5000-millisecond "Hard" wait. $MV22=V21-V20 $MV22=V22-5000 There were $SV22 milliseconds of "overhead".#W2000 Now we will test how long it takes to put 1000 characters out to the screen...#W2000 Press any key to continue.#R@C#Y[2,0] 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 1234567890123456789012345678901234567890123456789 #Y[2,1]$AV22=V5 $MV23=1000/V22 It took $SV22 milliseconds to print 1000 characters to the screen. This is $SV23 characters per millisecond. Press any key to exit#R |
#Y[2,0]#W1000#Y[2,1] A one second wait took $SV5 milliseconds |
#W command took one millisecond or
longer, this would be reflected in an output value larger than "1000 milliseconds".
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |