home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / pascal / 4641 < prev    next >
Encoding:
Text File  |  1992-07-30  |  1.8 KB  |  43 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!psgrain!qiclab!leonard
  3. From: leonard@qiclab.scn.rain.com (Leonard Erickson)
  4. Subject: Re: packtime and unpacktime algorithms?
  5. Message-ID: <1992Jul31.084159.18466@qiclab.scn.rain.com>
  6. Reply-To: 70465.203@compuserve.com
  7. Organization: SCN Research/Qic Laboratories of Tigard, Oregon.
  8. References: <31597@adm.brl.mil>
  9. Date: Fri, 31 Jul 1992 08:41:59 GMT
  10. Lines: 31
  11.  
  12. STANKULI%UWF.BITNET@vtvm2.cc.vt.edu ( stan kulikowski ii) writes:
  13.  
  14. >  does anyone have access to tp's algorithms for packtime and unpacktime
  15. >procedures?  the longint returned by packtime is not a standard julian
  16. >date so i would like to know what the limits in the numerical conversion
  17. >are.  i assume this was established by microsoft somewhere when they set up
  18. >their FAT specifications.
  19.  
  20. Split it into a pair of words. The first is the time, coded like this:
  21.     time= (hour*2048) + (minutes*32) + (seconds div 2)
  22.  
  23. the second is the date, coded as follows:
  24.     date= ((year-1980)*512) + (month*32) + day
  25.  
  26. >it seems a shame that the datetime type defined in the dos unit does not have
  27. >100th seconds in it so we could use the thing for elapsed time measurements
  28. >within the 10th second accuracy we can get from the clock.
  29.  
  30. If you examine the above, you'll see that DateTime isn't good for better than
  31. 2 second accuracy anyway. If you are going to use "accurate" timing, declare
  32. a longint at the system timer count. 
  33.     TimerCount : longint absolute $0040:$006C;
  34.  
  35. This gives you the full 18.2 Hz accuracy of the timer tick.
  36. (Just don't forget that it resets to 0 at midnite!)
  37.  
  38. -- 
  39. Leonard Erickson              leonard@qiclab.scn.rain.com
  40. CIS: [70465,203]             70465.203@compuserve.com
  41. FIDO:   1:105/56     Leonard.Erickson@f56.n105.z1.fidonet.org
  42. (The CIS address is checked daily. The others infrequently)
  43.