home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zodiac Super OZ
/
MEDIADEPOT.ISO
/
FILES
/
13
/
N_B_V203.ZIP
/
MDELAY.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
60 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME MDELAY .DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "DAS-NB01.INC"
COLOR 7, 0
CLS
? "┌─────────────────────────────────────────────────────────────────────────────
? "│ MDelay ( Msecs% ) Just like DELAY but uses 1/1000ths of a second
? "│ SetDelay ( Msecs% ) Initiate and start an MDelay counter
? "│ EndDelay () Wait for MDelay counter to hit 0
? "│ fEndDelay% () Same as above but returns Msecs% at time of calling
? "├─────────────────────────────────────────────────────────────────────────────
? "│ This family of subs brings almost infinite time control to your programs!
? "│ They work about 20 times more accurately than DELAY and you are given the
? "│ capability of setting the timer, doing some work, THEN pausing until bell
? "│ bell rings!
? "│
? "│ fEndDelay% is a programmer's tool as it works just like EndDelay but returns
? "│ the time remaining on the clock when it was called.
? "└─────────────────────────────────────────────────────────────────────────────
?
T! = TIMER
MDelay 50
T! = ( TIMER - T! )
PRINT USING "ELAPSED TIME FOR 50 msec: #.#### seconds"; T!
PRINT
T! = TIMER
SetDelay 500
PRINT "PAUSE THE PROGRAM FOR .5 sec. INCLUDING THE TIME SPENT PRINTING THIS!"
EndDelay
T! = ( TIMER - T! )
PRINT USING "ELAPSED TIME: #.#### seconds"; T!
PRINT
SetDelay 500
PRINT "THE TIME HAS ";
DELAY 1
IF fEndDelay% THEN PRINT "NOT ";
PRINT "RUN OUT!"