Timer() question

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
victorf
Posts: 342
Joined: 01 January 2006, 4:08 AM
Location: Schenectady, New York

Timer() question

Post by victorf »

SysLib has this to say about the Timer() function:

"This function returns the current RTC time represented as the number of seconds since midnight ..."

May I assume that the time really means "since power up" unless an effort has been made, somehow, to set the RTC to agree with watch time? If I capture Timer() time at power up and then wait 60 seconds will Timer() return 60.0?

Any enlightenment will be appreciated.

Vic
Vic Fraenckel
KC2GUI
windswaytoo ATSIGN gmail DOT com
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Timer() question

Post by dkinzer »

victorf wrote:May I assume that the time really means "since power up" unless an effort has been made, somehow, to set the RTC to agree with watch time?
When the ZX is reset or powered up, the RTC is initialized to midnight, January 1, 1999 and then it keeps track of the time relative to that. Unless you have a means to synchronize the ZX RTC with real time, it is really only useful for relative time notions.
victorf wrote:If I capture Timer() time at power up and then wait 60 seconds will Timer() return 60.0?
Exactly so.
- Don Kinzer
Post Reply