Ido” – Time

“Fun” Facts:
Tudtatok, hogy a Delphi TTimer felbontasat bar 1 ms lepesenkent lehet allitani, de a valodi felbontasa csak 1/64 s (masodperc) = 15.625ms (Windows Timer). Regebben, meg a DOS-os idokben olvastam a PC idozito/ora felepiteserol, es BIOS megszakitasairol. Oh a kedves INT 08h es 1ch (a kedvenc Ralf Brown interrupt list-bol) es az Intel 8254 rendszer ora, ami interruptot general minden 54.936 ms-onkent, kb. 18.2-szor masodpercenkent.
Azota nem kovettem a PC architekturanak/operacios rendszernek ezen valtozasat (egyebeket igen). Hat itt az ideje egy kicsit utananezni:
“timestamps that you can obtain from Windows NT are limited to a maximum resolution of 10 or 15 milliseconds, depending on the underlying hardware.”
Implement a Continuously Updating, High-Resolution Time Provider for Windows
Jelenleg idobellyegezesre a GetSystemTimeAsFileTime -ot hasznalom (100ns=0.1us LSB). Sajnos ennek a felbontasa messze elmarad az abrazolasi pontossagtol: 155860 LSB=15.586ms.
Teljesitmeny meresre, optimalizalasra RDTSC utasitast. (CPU orajel)

Egyebkent a leiras hibas az MSDN-en “Retrieves the current system date and time. The information is in Coordinated Universal Time (UTC) format.”
GetSystemTimeAsFileTime Function
A helyes leiras a FILETIME Structure-nal van: “Contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).”
FILETIME Structure
Vagyis 1601.01.01 ota eltelt UTC masodperceket adja vissza ami nem azono az UTC formatummal, aminek pont az a lenyege, hogy kulon abrazolja a percet a masodperctol egy stringben, ami lehetove teszi a szokomasodpercek bevitelet, vagyis elofordulhat hogy 59 utan nem 00 jon a masodperc helyen, hanem 60. Igazabol vilagos leirast az UTC formatumara nem talaltam, bar sok helyen lattam az ISO 8601 abrazolast.

Nahat mar a magyar wikipedian is fent van:
Szökőmásodperc
Egyezményes koordinált világidő

Ezt erdemes megnezni:
www.fourmilab.ch/cgi-bin/Earth
www.fourmilab.ch/cgi-bin/uncgi/Earth/action?opt=-p
www.fourmilab.ch/earthview/satellite.html

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.