9 Mayıs 2018 Çarşamba

Monotonic saat

Monotonic Saat Nedir?
Hiç bir zaman geriye gitmeyen, hep ileri giden ve NTP'den etkilenmeyen bir sayaçtır. Genellikle 64 bit büyüklüğündedir ve nanosaniye cinsindendir.

Bütün monotonic saatler Intel 8253, 8254 veya türevi bir çip kullanırlar. 

Monotonic saat ile sistem saati farklıdır. Sistem saati için ilk çip sanırım IBM PC ile geldi. Açıklaması şöyle
IBM PC/AT added a battery backed real-time clock chip that independently maintained time whether the system was powered or not.
Açıklaması şöyle
It updates a counter, stored in memory as a double word at 0x0040:0x006C, and checks for elapsing days, setting the flag at 0x0040:0x0070 on date changes. These values can be retrieved using interrupt 0x1A service 0x00.

The “real” date and time are tracked by the operating system; in DOS, they could be retrieved using interrupt 0x21 service 0x2A and set using service 0x2B.

System time handling after boot didn’t change with the advent of battery-backed RTCs: the system date and time were still supposed to be updated using the timer IRQ. The BIOS added functions to provide access to the RTC (e.g. interrupt 0x1A service 0x02 to read the clock time), and DOS used those to initialise its own date and time; but after that the RTC wasn’t used in normal operations.

This is still the case nowadays: the RTC is used to initialise the date and time at boot, and after that time is tracked using timers (not the same ones as in the original IBM PC, but still timers).
...


C#
Stopwatch Sınıfı yazısına taşıdım.

C++11
std::chrono::steady_clock Sınıfı yazısına taşıdım.

Posix
clock_gettime
clock_gettime metodu yazısına taşıdım.


Java
System.nanoTime() metodu kullanılır. System Sınıfı yazısına taşıdım.


Windows
GetTickCount
Monotonic Saat - Windows yazısına taşıdım.


GetTickCount64
Monotonic Saat - Windows yazısına taşıdım.

QueryPerformanceCounter
QueryPerformanceCounter metodu yazısına taşıdım.

ARINC 653
GET_TIME
ARINC 653 GET_TIME metodu yazısına taşıdım

Hiç yorum yok:

Yorum Gönder