Re: SDL-News: time conversion

Subject: Re: SDL-News: time conversion
From: Rick Reed TSE (
Date: Sat Dec 16 2000 - 10:46:42 GMT

Become an SDL Forum Society member <>
The originator of this message is responsible for its content.
-----From Rick Reed TSE <> to sdlnews -----

Thomas Weigert at wrote on 16/12/2000 02:51:

> We could, of course, also wonder why it has to be that time and duration
> have their special data types (in particular, as these are not very
> sophisticated types---no date fields, etc.). One could use reals for setting
> timers etc. just as well?
> Is there any good reason for not using reals to set SDL timers?

Yes, there is.

Because Time is a separate type, any value that is used to set a TIMER must
be a Time value. The general principle of strong type checking applies. The
operations on the Time type are limited, so that it is not possible to (for
example) add a Time to a Time or multiply a Time by a Time. Like any strong
type checking, this rejects some coding errors and therefore helps to assure

In any case, absolute Time values are not usually very useful, unless
expressed in terms of NOW + d, where d is a Duration value.

Rick Reed -
Tel:+44 1455 55 96 55 Fax:+44 1455 55 96 58 Mob.:+44 7970 50 96 50

--End text from Rick Reed TSE <> to sdlnews --- For extra SDL Forum Society benefits join at <>

This archive was generated by hypermail 2a23 : Thu May 09 2013 - 16:05:49 GMT