Dec 232017
Great TP5.5 CMOS and DOS clock/timer objects.
File CLOCKSTP.ZIP from The Programmer’s Corner in
Category Pascal Source Code
Great TP5.5 CMOS and DOS clock/timer objects.
File Name File Size Zip Size Zip Type
CLKDEMO.EXE 17504 8818 deflated
CLKDEMO.OUT 3359 1167 deflated
CLKDEMO.PAS 6579 1952 deflated
CLOCKS.DOC 4210 1827 deflated
CLOCKS.PAS 12805 4262 deflated
CLOCKS.TPU 8656 3799 deflated
DELL220.FLP 400 232 deflated
FLOPS.EXE 10992 6543 deflated
FLOPS.PAS 3704 1111 deflated
TIMER.EXE 10560 6472 deflated
TIMER.LOG 404 178 deflated
TIMER.PAS 2591 1060 deflated
TMRDEMO.BAT 163 108 deflated
TOSH3100.FLP 400 233 deflated

Download File CLOCKSTP.ZIP Here

Contents of the CLOCKS.DOC file

CMOS/DOS Real-Time Clock Object
and REXX-like Date/Time Formatting Functions
in Turbo Pascal 5.5


Earl F. Glynn
Overland Park, KS
Compuserve 73257,3527

Clock objects can be used as individual timers, using either the CMOS
real-time clock, or the DOS real-time clock. As shown in the ClkDemo
PROGRAM, the DOS clock can be shut off when interrupts are disabled.
The precision of the CMOS clock is only 1 second, while the DOS clock
has 0.0549 second resolution (18.203 ticks per second). In addition
to real-time clocks, static time stamps can be manipulated and
formatted. The range for all clocks and time stamps is January 1, 1900
through June 5, 2079. (September 18, 1989 is the midpoint of this range).

Several REXX-like FUNCTIONs provide Date/Time formatting. [REXX,
the Restructured Extended Executor, or sometimes called the System Product
Interpreter, is IBM's SAA command language (now primarily for VM/CMS).
That is, REXX EXECs are CMS's equivalent of PC .BAT files but REXX
provides much more functionality than the PC 'BAT' language.]

REXX-like FUNCTIONS in Pascal could be considered an oxymoron since
REXX doesn't have any concept of TYPEd variables and obviously Pascal does.
The Pascal functions in most cases were written to return STRINGs,
which is similar to REXX. In some cases, where a number was returned
that could be used in calculations, a separate function was used. For
example, the REXX TIME('Elapsed') function was implemented as an object
'Elapsed' method that returns a REAL value to be used in calculations.
A function 'hhmmss' can be used to format elapsed seconds in a
character string, if desired.

The REXX 'Date' and 'Time' functions are only defined for the current
date and time. To allow flexibility in printing time stamps, such as
a file's time stamp, 'DateFormat' and 'TimeFormat' were written.

Once a real-time clock is started with its 'Start' method, the 'Date'
and 'Time' methods return this start time. The 'Elapsed' method
returns the real-time clock value in seconds. 'Start' must be called
to update 'Date' and 'Time' values.

CMOS and DOS clocks should be calibrated against a known, reliable time
source such as the National Bureau of Standards WWV time standard (available
via phone or shortwave radio). A correction factor could be added
to the 'Elapsed' method, if necessary. (Note the clocks have 'precision'
but not necessarily 'accuracy' -- something I have not seen addressed
in the microsecond timers on microcomputers).

See the CLKDEMO.PAS, FLOPS.PAS and TIMER.PAS programs for sample usage
of clock objects and this UNIT.

File D e s c r i p t i o n
------------ ----------------------------------------------------------
CLOCKS.DOC This file.
CLOCKS.PAS Real-time clock object and REXX-like formatting functions.
Methods: Date,Time,Start,Elapsed. Functions/Procedures:
CLOCKS.TPU Compiled CLOCKS Turbo Pascal UNIT.

CLKDEMO.PAS Examples of how the CLOCKS UNIT can be used.
CMOS/DOS Clock Differences
Date/DateFormat Examples
Time/TimeFormat Examples
Time Differences/Elapsed Time

FLOPS.PAS Floating-Point Operations Per Second (FLOPS) Benchmark
with REAL matrices > 65535 bytes in size
FLOPS.EXE Compiled form of FLOPS.PAS
DELL220.FLP FLOPS output from Dell 220
TOSH3100.FLP FLOPS output from Toshiba 3100

TIMER.PAS Time any program execution from native DOS or from a BAT file
TIMER.EXE Compiled form of TIMER.PAS
TMRDEMO.BAT Example of how to use TIMER from a BAT file.
TIMER.LOG Output timer log from TMRDEMO.BAT example

 December 23, 2017  Add comments

Leave a Reply