diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/Manual/en/BH_Timer.pod | 82 | ||||
| -rw-r--r-- | doc/Manual/en/Makefile | 2 | ||||
| -rw-r--r-- | doc/Manual/ru/BH_Timer.pod | 83 | ||||
| -rw-r--r-- | doc/Manual/ru/Makefile | 2 |
4 files changed, 169 insertions, 0 deletions
diff --git a/doc/Manual/en/BH_Timer.pod b/doc/Manual/en/BH_Timer.pod new file mode 100644 index 0000000..56e79fe --- /dev/null +++ b/doc/Manual/en/BH_Timer.pod @@ -0,0 +1,82 @@ +=encoding UTF-8 + + +=head1 NAME + +BH_Timer - timer utilities + + +=head1 SYNTAX + + #include <BH/Timer.h> + + cc prog.c -o prog -lbh + + +=head1 DESCRIPTION + +This module provides a simple high-resolution timer interface for measuring +elapsed time. The timer uses a monotonic clock source when available, making it +suitable for accurate time measurements, such as profiling or timeouts. It +supports millisecond and nanosecond precision and can be started, restarted, +and queried for elapsed time. + + + +=head1 API CALLS + + +=head2 BH_TimerNew + + BH_Timer *BH_TimerNew(void); + +Creates and initializes a new timer object. + +Returns a pointer to a newly allocated BH_Timer on success, or NULL on failure. + + +=head2 BH_TimerFree + + void BH_TimerFree(BH_Timer *timer); + +Destroys the timer. + +=head2 BH_TimerIsMonotonic + + int BH_TimerIsMonotonic(BH_Timer *timer); + +Checks whether the timer uses a monotonic clock source. + + +=head2 BH_TimerStart + + void BH_TimerStart(BH_Timer *timer); + +Starts or resets the timer to begin counting from the current time. + + +=head2 BH_TimerRestart + + int64_t BH_TimerRestart(BH_Timer *timer); + +Restarts the timer and returns the number of milliseconds that had elapsed since +the start of the timer. + + +=head2 BH_TimerMilliseconds + + int64_t BH_TimerMilliseconds(BH_Timer *timer); + +Returns the number of milliseconds that had elapsed since the start of the +timer. + + +=head2 BH_TimerNanoseconds + + int64_t BH_TimerNanoseconds(BH_Timer *timer); + +Returns the number of nanoseconds that had elapsed since the start of the timer. + +=head1 SEE ALSO + +L<BH> diff --git a/doc/Manual/en/Makefile b/doc/Manual/en/Makefile index f5ff1f7..b2fd873 100644 --- a/doc/Manual/en/Makefile +++ b/doc/Manual/en/Makefile @@ -20,6 +20,7 @@ HTMLS = BH_Algo.html \ BH_Ray3f.html \ BH_String.html \ BH_Thread.html \ + BH_Timer.html \ BH_Unicode.html \ BH_Util.html \ BH_Vec2f.html \ @@ -48,6 +49,7 @@ MANS = BH_Algo.3 \ BH_Ray3f.3 \ BH_String.3 \ BH_Thread.3 \ + BH_Timer.3 \ BH_Unicode.3 \ BH_Util.3 \ BH_Vec2f.3 \ diff --git a/doc/Manual/ru/BH_Timer.pod b/doc/Manual/ru/BH_Timer.pod new file mode 100644 index 0000000..290ec11 --- /dev/null +++ b/doc/Manual/ru/BH_Timer.pod @@ -0,0 +1,83 @@ +=encoding UTF-8 + + +=head1 НАЗВАНИЕ + +BH_Timer - утилиты таймера + + +=head1 СИНТАКСИС + + #include <BH/Timer.h> + + cc prog.c -o prog -lbh + + +=head1 ОПИСАНИЕ + +Этот модуль предоставляет простой интерфейс высокоточного таймера для измерения +прошедшего времени. По возможности таймер использует монотонный источник часов, +что делает его подходящим для точных измерений времени, например, профилирования +или тайм-аутов. Поддерживается точность в миллисекундах и наносекундах; таймер +можно запускать, перезапускать и запрашивать прошедшее время. + + +=head1 API ВЫЗОВЫ + + +=head2 BH_TimerNew + + BH_Timer *BH_TimerNew(void); + +Создаёт и инициализирует новый объект таймера. + +В случае успеха функция возвращает указатель на новый объект BH_Timer, +или NULL в случае ошибки. + + +=head2 BH_TimerFree + + void BH_TimerFree(BH_Timer *timer); + +Уничтожает таймер. + + +=head2 BH_TimerIsMonotonic + + int BH_TimerIsMonotonic(BH_Timer *timer); + +Проверяет, использует ли таймер монотонный источник времени. + + +=head2 BH_TimerStart + + void BH_TimerStart(BH_Timer *timer); + +Запускает или сбрасывает таймер, начиная отсчёт с текущего момента времени. + + +=head2 BH_TimerRestart + + int64_t BH_TimerRestart(BH_Timer *timer); + +Перезапускает таймер и возвращает количество миллисекунд, прошедших с момента +его запуска. + + +=head2 BH_TimerMilliseconds + + int64_t BH_TimerMilliseconds(BH_Timer *timer); + +Возвращает количество миллисекунд, прошедших с момента запуска таймера. + + +=head2 BH_TimerNanoseconds + + int64_t BH_TimerNanoseconds(BH_Timer *timer); + +Возвращает количество наносекунд, прошедших с момента запуска таймера. + + +=head1 СМ. ТАКЖЕ + +L<BH> diff --git a/doc/Manual/ru/Makefile b/doc/Manual/ru/Makefile index f5ff1f7..b2fd873 100644 --- a/doc/Manual/ru/Makefile +++ b/doc/Manual/ru/Makefile @@ -20,6 +20,7 @@ HTMLS = BH_Algo.html \ BH_Ray3f.html \ BH_String.html \ BH_Thread.html \ + BH_Timer.html \ BH_Unicode.html \ BH_Util.html \ BH_Vec2f.html \ @@ -48,6 +49,7 @@ MANS = BH_Algo.3 \ BH_Ray3f.3 \ BH_String.3 \ BH_Thread.3 \ + BH_Timer.3 \ BH_Unicode.3 \ BH_Util.3 \ BH_Vec2f.3 \ |
