Board index » delphi » Uptime in TP 5.5

Uptime in TP 5.5

Is it possible for me to get the uptime in TP 5.5... i need this for a
timeout function...

Mabey there is another way to do it !...

All i need is to find out is xx minuttes have passed since the creation of
an object, i would have sone it by storing the Date and time with the
object, but would like to hear if someone have a better idea... like
delphi's TDateTime where the value is a number and not 6-7 numbers....

Could you email me a copy of your responce THANKS..

Thank you...

Jeppe, Denmark

 

Re:Uptime in TP 5.5


JRS:  In article <8hecoq$t7...@news.inet.tele.dk> of Sun, 4 Jun 2000
22:12:04 seen in news:comp.lang.pascal.borland, Jeppe Haugstrup

Quote
<haugs...@post4.tele.dk> wrote:
> ...
>All i need is to find out is xx minuttes have passed since the creation of
>an object, i would have sone it by storing the Date and time with the
>object, but would like to hear if someone have a better idea... like
>delphi's TDateTime where the value is a number and not 6-7 numbers....

Store MemL[$40:$6C], after reading atomically (see my pas-time.htm).

Quote

>Could you email me a copy of your responce THANKS..

Technology permits; policy debars.  QHAH.

--
? John Stockton, Surrey, UK.  j...@merlyn.demon.co.uk   Turnpike v4.00   MIME. ?
 <URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
 <URL: ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ;
 <URL: http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ.

Re:Uptime in TP 5.5


Quote
"Jeppe Haugstrup" <haugs...@post4.tele.dk> wrote in message

news:8hecoq$t7i$1@news.inet.tele.dk...

Quote
> Is it possible for me to get the uptime in TP 5.5... i need this for a
> timeout function...

> Mabey there is another way to do it !...

> All i need is to find out is xx minuttes have passed since the creation of
> an object, i would have sone it by storing the Date and time with the
> object, but would like to hear if someone have a better idea... like
> delphi's TDateTime where the value is a number and not 6-7 numbers....

If the expected lifetime of your objects is less than a day, you can create
a timestamp as follows:

   timestamp := hour*3600+minute*60+sec;

subtracting the timestamp from the current time will give you the elapsed
time (if you get a negative value - add 86400, the number of seconds in a
day, to the result). If your objects may live longer than a day, you will
have to calculate the offset in days between the two dates. Look up
algorithms for calculating the Julian date, which converts a given date to a
number.

Daniel Pfeffer

Other Threads