Re: time

new topic     » goto parent     » topic index » view thread      » older message » newer message

----- Original Message -----
From: Robert Craig <rds at ATTCANADA.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Friday, February 04, 2000 1:28 PM
Subject: Re: time


> Kat writes:
> > Errr, i can't find how to set time() in the Eu docs.... is it possible?
>
> There's a DOS interrupt for this. See
> doswrap.e in the Jacques Deschenes Collection.
>
> In Windows, Jesus Consuegra has a program in the Archive
> that sets your computer's time. He gets the time
> from a special site on the Internet.

I don't want to reset the *computer's* time, just this arbitrary time-thing.

> > Syntax: a = time()
> > Description: Return the number of seconds since some
> > fixed point in the past.
> >
> > *What* fixed point?
>
> You are supposed to use time() to measure
> differences in time. I don't guarantee that it will always
> start at 0 on all versions of DOS, Windows and Linux.
> You can set a variable:  start_time = time()
> and then measure the difference from that.
> If you want the time of day (to the second),
> use Euphoria's date() routine.

Mine didn't return 0 the first call either, it is called quite soon after
the program starts, and returns 0.4 or so. Seems to me if i must use dos
interrupts, there are better ones to use where i am now using time(), ints
that don't suffer the 24hr reset that time() does.

> > If someone uses this in dos at 23:59
> > after it's started, and calls it again in 20 minutes to time
> > a duration,, they'll get an error.
>
> There's no problem crossing the midnight boundary,
> but you can't (easily) time something that takes
> longer than 24 hours.
>
> > Can it be reset to 0 in dos or win95?
>
> No. Just set start_time = time() again.

Hmm,, if i use my own time() function, i can set/return from those better
dos interrupts... seems i did see something in the archives under timers()
that called these ints. Doing a time(0) would simply set a Var to current
ticks since epoch, and the next call to time() would return the
NowCurrentTicks minus Var. /me looks up Jesus,, which (believe me) is
against her religion, lol.

Any idea of the performance hit for dos calls under windoze?

> Regards,
>      Rob Craig

Hi Rob!
Kat smile

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu