Timing an Event in DataFlex
by Curtis Krauskopf
long did that take?" That's a question I ask
myself when I'm doing software engineering. I oftentimes
encounter two different algorithms that perform the
same task but they do it in significantly different
amounts of time.
does matter. A process that takes one second to finish
on my development database can take an hour on my customer's
database because their database is 3600 times bigger
than my test database. Sometimes
that's acceptable. Most often it's not.
I need to time how long things take in DataFlex. Over
the years, I've developed some useful techniques for
measuring how long things take. Some are so accurate
that they even detect the amount of time that Windows
steals from a process to do its own processing.
Ticking away the moments that make up a dull day.
You fritter and waste the hours in an offhand way.
Kicking around on a piece of ground in your hometown.
Waiting for someone or something to show you the
Dark Side of the Moon: Pink Floyd
by Mason, Waters, Wright, Gilmore
has three commands that are able to either directly
or indirectly time how long an event takes:
SYSDATE and SYSDATE4
and SYSDATE4 both do almost the same thing. They both
obtain the current date and time information from the
operating system. The only difference between them is
that SYSDATE returns a two digit year (03) whereas SYSDATE4
returns a four digit year (2003). Here's an example
of how to use SYSDATE4 (using SYSDATE is identical except
replace the SYSDATE4 command with SYSDATE):
// A simple demonstration of the sysdate4 command.
integer hour minute second
sysdate4 today hour minute second
showln "Today is " today
showln "The current time is: " hour ":" minute ":" second
showln "Press any key to continue."
string akey 1
is the output:
date will appear in the default format for your DataFlex
installation. This is defined in the DFCONFIG utility.
The three available date formats are:
addition, the separator character (which defaults to
'/') can also be defined. Any character can be used.
The most common separators I've seen are:
How Long Did that Take?
Copyright 2003-2010 The Database Managers, Inc.
Long Did that Take?
this so Inconsistent?
SYSDATE for Microsecond Timing
the SET_TIMER resolution