a1200   NEWS   APPS   DOCS   ABOUT
a1200
----
a1200
----
Autodocs
 Libraries:
 lowlevel.library
  AddKBInt
  AddTimerInt
  AddVBlankInt
  ElapsedTime
  GetKey
  GetLanguageSelection
  QueryKeys
  ReadJoyPort
  RemKBInt
  RemTimerInt
  RemVBlankInt
  SetJoyPortAttrsA
  StartTimerInt
  StopTimerInt
  SystemControlA
Include
GuruMeditation
Docs » Autodocs » lowlevel.library » ElapsedTime

NAME

	ElapsedTime -- returns the time elapsed since it was last called. (V40)

SYNOPSIS

	fractionalSeconds = ElapsedTime(context);
D0 A0
ULONG ElapsedTime(struct EClockVal *);

FUNCTION

	This function utilizes the timer.device/ReadEClock() function to get
an accurate elapsed time value. Since the context needs to be
established the first call to this routine will return a nonsense
value.
The return value for this function only allows for sixteen bits
worth for the integer number of seconds and sixteen bits for the
factional number of seconds.
With sixteen bits worth of integer seconds this function can be
used to timer an interval up to about 16 hours. If the actual time
interval is larger this function will return this maximum value.
The sixteen bits for fractional seconds gives a resolution of
approximately 20 microseconds. However, it is not recomended
to expect this function to be accurate for a time interval of
less than 200 microseconds.

INPUTS

	context - pointer to an EClockVal structure. The first time you
call this function, you should initialize the structure
to 0s. You should then reuse the same structure for
subsequent calls to this function, as this is how the
elapsed time is calculated.

RESULT

	fractionalSeconds - The elapsed time as a fixed point 32-bit
number with the point fixed in the middle.
That is, the upper order sixteen bits represent
the number of seconds elapsed. The low order
sixteen bit represent the fractional number of
seconds elapsed. This value is limited to about
sixteen hours. Although this value is precise
to nearly 20 microseconds it is only accurate to
within 200 microseconds.

WARNING

	The first call to this function will return a non-sense value. Only
rely on its result starting with the second call.

SEE ALSO

timer.device/ReadEClock()

Comments

Name:
E-mail: Use this if you want a message if you get a response, will not be shown.
Comment:
Select correct short for:

The Silents

FC
TSL
ATX
AOA

Comments:

$VER: d0.se 1.14 Copyright © 2011-2024 Tobias Geijersson support at d0 dot se