Информационный сервер для программистов: Исходники со всего света. Паскальные исходники со всего света
  Powered by Поисковый сервер Яndex: Найдется ВСЁ!
На Главную Pascal Форум Информер Страны мира
   Дата и Время    >>    timers
   
 
 LilPIT - Precision Interval Timers  Woburn Software 23.12.1988

Модуль для организации до 64 независимых счетчиков времени, обеспечивающих точность либо 1 секунда, либо 1 тик.
This small unit provides TIMERS. Timers mark intervals with one-second resolution. There are 64 separate timers, referenced 0 to 63.



5k 
 

In hardware there are devices called precision interval generators or precision interval timers, PIGs and PITs. One of their functions that is often used to time out real time events is a downcounter. A downcounter tells you when a pre -set time interval has elapsed. Here is a turbo pascal 5.0 unit called "lilpit" that has software PITs. There are two sets, one with one-second resolution and one with about 50 millisecond resolution. The trade off for resolution is execution time. The one_second flavor runs about 3 times faster than the millisecond kind. The software is simple to interface. You have to "preset or START the timer with a call specifying how long you want it to run. After that, you "poll" or TEST the timer to see if it has expired. There are some examples in the source code at the top of pascal source module LILPIT.PAS. Take a look at them. Lastly, there are some bells and whistles. There is a global debugging flag named "LILPIT_FATAL_ERROR" that catches some programmer or system slips. There is a very fast time/date string conversion function named "AT_TOD" and there is a simplistic timer number allocate/deallocate scheme named "get_a_timer_number" and "unget_a_timer_number." Lastly, there is an initialization/error recovery entry point called "reset_pit." Enjoy and Merry Christmas. WOBURN SOFTWARE ASSOCIATES 6 Lawson Street Woburn MA 01801-3718