{"id":25442095,"url":"https://github.com/catcodegames/intervaltimers","last_synced_at":"2025-11-01T14:30:23.584Z","repository":{"id":277734947,"uuid":"931551468","full_name":"CatCodeGames/IntervalTimers","owner":"CatCodeGames","description":"Timers for UniTask. Using UniTask's functionality to integrate with PlayerLoop. Featuring flexible settings and eliminating accumulation of errors in cyclic executions.","archived":false,"fork":false,"pushed_at":"2025-02-15T19:03:20.000Z","size":815,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T19:19:29.546Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"ShaderLab","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CatCodeGames.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-12T13:23:27.000Z","updated_at":"2025-02-15T19:03:23.000Z","dependencies_parsed_at":"2025-02-15T19:19:34.695Z","dependency_job_id":"faf29c4f-6286-478e-9924-e8354eed5412","html_url":"https://github.com/CatCodeGames/IntervalTimers","commit_stats":null,"previous_names":["catcodegames/intervaltimers"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CatCodeGames%2FIntervalTimers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CatCodeGames%2FIntervalTimers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CatCodeGames%2FIntervalTimers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CatCodeGames%2FIntervalTimers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CatCodeGames","download_url":"https://codeload.github.com/CatCodeGames/IntervalTimers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239293928,"owners_count":19615043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-17T13:16:49.302Z","updated_at":"2025-11-01T14:30:23.552Z","avatar_url":"https://github.com/CatCodeGames.png","language":"ShaderLab","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 1. Description\nTimers for UniTask. Using UniTask's functionality to integrate with PlayerLoop. Featuring flexible settings and eliminating accumulation of errors in cyclic executions.\\\n\n### Key Features and Advantages:\n- **Accuracy without error accumulation.**\\\n  Each timer tick accounts for the difference between the scheduled and actual execution times, preventing error accumulation.\n- **Configurable number of ticks.**\\\n You can set a specific number of timer ticks, such as having the timer run 10 times at one-second intervals and then stop.\n- **Choice of game cycle for execution.**\\\n The timer can run in various cycles like `Update`, `FixedUpdate`, and others.\n- **Custom time function.**\\\n You can use your own time function instead of the standard Time.time and Time.deltaTime.\n- **Multiple ticks per frame.**\\\n For very short intervals, the timer can trigger events multiple times within a single frame.\n- **Safe multiple starts and stops.**\\\n The timer remains stable even if Start() and Stop() are called multiple times within the same frame.\n- **On-the-fly parameter changes.**\\\n Parameters such as the interval and number of ticks can be adjusted during the timer's operation.\n- **Easy saving and copying.**\\\n Internal parameters like elapsed time and the number of ticks are accessible, making it easy to save the state or create copies.\n\n\u0026nbsp;\n# 2. Timers\n\n## 1. DeltaTimeTimer\n- Uses the difference in time between frames (`Time.deltaTime` and similar) for its calculations.\n- Upon stopping and restarting, continues without accounting for the time when the timer was paused.\n\n### Creation\n``` csharp\npublic static DeltaTimeTimer Create( float interval, int loopCount, InvokeMode invokeMode, bool unscaledTime, PlayerLoopTiming playerLoopTiming) \n```\n  - `interval` - The time interval after which the timer triggers the Elapsed event.\n  - `loopCount` - The number of times the timer should trigger the Elapsed event. -1 indicates an infinite loop.\n  - `invokeMode` - Determines whether the timer can trigger the Elapsed event multiple times within a single frame or only once.\n  - `unscaledTime` - Specifies whether to use Time.unscaledDeltaTime or Time.deltaTime for time calculation.\n  - `playerLoopTiming` - Determines which game loop (e.g., Update, FixedUpdate, etc.) the timer will use.\n\n``` csharp\npublic static DeltaTimeTimer Create( float interval, Func\u003cfloat\u003e getDeltaTime, int loopCount, InvokeMode invokeMode, PlayerLoopTiming playerLoopTiming)\n```\n- `getDeltaTime` - A custom function that returns the interval between the current and previous frame.\n\n### Properties\n#### Data\nContains all the working parameters of the timer.\n- `ElapsedTime` - The time since the timer was started or last triggered.\n- `Interval` - The time interval after which the timer triggers the Elapsed event.\n- `CompletedTicks` - The current number of times the timer has triggered.\n- `TotalTicks` - The number of times the timer should trigger. -1 indicates an infinite loop.\n\n#### TickData\nContains information about the last trigger of the timer. If the timer can trigger multiple times within a single frame, this property determines the number of event calls and their order.\n- `TicksPerFrame` - The number of times the timer triggers within a single frame.\n- `TickNumber` - The sequential number of the timer trigger in InvokeMode.Multi; always 0 in InvokeMode.Single.\n\n\n\u0026nbsp;\n## 2. RealtimeTimer\n- Uses game time (`Time.time` and similar, or a user-defined time function).\n- Upon stopping and restarting, triggers all missed events.\n- In the case of multiple events within a single frame, the timer accurately determines the time of each event using the Date.Time property.\n\n### Creation\n``` csharp\npublic static RealtimeTimer Create(float interval, int loopsCount, InvokeMode invokeMode, RealtimeMode timeMode, PlayerLoopTiming playerLoopTiming)\n```\n- `interval` - The time interval after which the timer triggers the `Elapsed` event.\n- `loopCount` - The number of times the timer should trigger the `Elapsed` event. `-1` indicates an infinite loop.\n- `invokeMode` - Determines whether the timer can trigger the Elapsed event multiple times within a single frame or only once.\n- `timeMode` - Specifies the type of time used: `Time.unscaledTime`, `Time.time`, or `Time.realtimeSinceStartup`.\n- `playerLoopTiming` - Determines which game loop (e.g., Update, FixedUpdate, etc.) the timer will use.\n\n``` csharp\npublic static RealtimeTimer Create(float interval, Func\u003cfloat\u003e getTime, int loopsCount, InvokeMode invokeMode, PlayerLoopTiming playerLoopTiming)\n```\n- `getDeltaTime`: A custom function that returns the interval between the current and previous frame.\n\n### Properties\n#### Data\nContains all the working parameters of the timer.\n- `LastTime` - The time of the last trigger or when the timer started.\n- `Interval` - The time interval after which the timer triggers the `Elapsed` event.\n- `CompletedTicks` - The current number of times the timer has triggered.\n- `TotalTicks` - The total number of times the timer will trigger before stopping. `-1` indicates an infinite loop.\n\n#### TickData\nContains information about the last trigger of the timer. If the timer can trigger multiple times within a single frame, this property determines the number of event calls and their order.\n- `TicksPerFrame` - The number of times the timer triggers within a single frame.\n- `TickNumber` - The sequential number of the timer trigger in InvokeMode.Multi; always 0 in InvokeMode.Single.\n\n\n\u0026nbsp;\n## 3. DateTimeTimer\n- Uses system time (`DateTime.Now` or a user-defined function).\n- Upon stopping and restarting, triggers all missed events.\n- In the case of multiple events within a single frame, the timer accurately determines the time of each event using the Date.Time property.\n- \n### Creation\n``` csharp\npublic static DateTimeTimer Create(TimeSpan interval, int loopsCount, InvokeMode invokeMode, PlayerLoopTiming playerLoopTiming)\n```\n- `interval` - The time interval after which the timer triggers the `Elapsed` event.\n- `loopCount` - The number of times the timer should trigger the `Elapsed` event. `-1` indicates an infinite loop.\n- `invokeMode` - Determines whether the timer can trigger the Elapsed event multiple times within a single frame or only once.\n- `playerLoopTiming` - Determines which game loop (e.g., Update, FixedUpdate, etc.) the timer will use.\n\n``` csharp\npublic static DateTimeTimer Create(TimeSpan interval, Func\u003cDateTime\u003e getTime, int loopsCount, InvokeMode invokeMode, PlayerLoopTiming playerLoopTiming)\n```\n- `getDeltaTime`: A custom function that returns the interval between the current and previous frame.\n\n### Properties\n#### Data\nContains all the working parameters of the timer.\n- `LastTime` - The time of the last trigger or when the timer started.\n- `Interval` - The time interval after which the timer triggers the `Elapsed` event.\n- `CompletedTicks` - The current number of times the timer has triggered.\n- `TotalTicks` - The total number of times the timer will trigger before stopping. `-1` indicates an infinite loop.\n\n#### TickData\nContains information about the last trigger of the timer. If the timer can trigger multiple times within a single frame, this property determines the number of event calls and their order.\n- `TicksPerFrame` - The number of times the timer triggers within a single frame.\n- `TickNumber` - The sequential number of the timer trigger in InvokeMode.Multi; always 0 in InvokeMode.Single.\n\n\n\u0026nbsp;\n# 3. Examples\nAn example of a timer that ticks every second and stops after 10 ticks\n``` csharp\n    float interval = 1f;\n    int loopCount = 10;\n    // Custom time function for example.\n    Func\u003cfloat\u003e getTime = GameWorldTime.GetTime;\n    InvokeMode invokeMode = InvokeMode.Multi;\n    \n    // Create timer\n    var timer = RealtimeTimer.Create(interval, getTime, loopCount, invokeMode);\n    \n    timer.Elapsed += () =\u003e { Debug.Log($\"Elapsed at realtime {Time.time}. Calculate time - {timer.Data.LastTime}\"); };\n    timer.Started += () =\u003e Debug.Log(\"Timer started\");\n    timer.Stopped += () =\u003e Debug.Log(\"Timer stopped\");\n    timer.Completed += () =\u003e Debug.Log(\"Tier finished\");\n    \n    // Start or resume the timer\n    timer.Start();\n    \n    // Modify timer properties\n    timer.Data.Interval = interval * 2;\n    timer.Data.LastTime = GameWorldTime.GetTime() + 10;\n    \n    // Stop the timer, with the ability to resume.\n    timer.Stop();\n    \n    // Stop and reset the timer\n    timer.Reset();\n```\n\n## InvokeMode\nWhen the timer's interval is shorter than the frame time, this parameter defines how the timer will trigger events.\n### InvokeMode.Multi\nIn this mode, the `Elapsed` event is called multiple times within a single frame. The `TickData` property provides information on how many times the timer has triggered and the sequence number of the current event.\n``` csharp\n    float interval = 0.005f;\n    int loopCount = 5;\n    \n    var timer = DeltaTimeTimer.Create(interval, loopCount, invokeMode: InvokeMode.Multi);\n    timer.Started += ()=\u003e Debug.Log($\"Timer started at {Time.time}\");\n    timer.Completed += () =\u003e Debug.Log($\"Timer finished at {Time.time}\");\n    timer.Elapsed += () =\u003e Debug.Log($\"Current time - {Time.time}. Scheduled time - {timer.Data.LastTime}. Ticks - {timer.TickData.TickNumber + 1}/{timer.TickData.TicksPerFrame}\");\n\n    timer.Start();\n```\nOutput\n```\n  Timer started at 19,02731\n  Current time - 19,03973. Scheduled time - 19,03231. Ticks - 1/2\n  Current time - 19,03973. Scheduled time - 19,03731. Ticks - 2/2\n  Current time - 19,05369. Scheduled time - 19,04231. Ticks - 1/3\n  Current time - 19,05369. Scheduled time - 19,04731. Ticks - 2/3\n  Current time - 19,05369. Scheduled time - 19,05231. Ticks - 3/3\n  Timer finished at 19,05369\n```\n### InvokeMode.Single\nIn this mode, the `Elapsed` method is called once per frame. The `TickData` properties provide information only about the number of timer triggers.\n``` csharp\n    float interval = 0.005f;\n    int loopCount = 5;\n    \n    var timer = DeltaTimeTimer.Create(interval, loopCount, invokeMode: InvokeMode.Single);\n    timer.Started += ()=\u003e Debug.Log($\"Timer started at {Time.time}\");\n    timer.Completed += () =\u003e Debug.Log($\"Timer finished at {Time.time}\");\n    timer.Elapsed += () =\u003e Debug.Log($\"Current time - {Time.time}. Ticks - {timer.TickData.TicksPerFrame}\");\n\n    timer.Start();\n```\nВывод\n```\n  Timer started at 19,02731\n  Current time - 19,03973. Ticks - 2\n  Current time - 19,05369. Ticks - 3\n  Timer finished at 19,05369\n```\n\n\n\n\n\n\n\n\n\u0026nbsp;\n\u0026nbsp;\n# 1. Описание \nТаймеры для UniTask. Используют функционал библиотеки UniTask для интеграции в PlayerLoop. Имеют гибкие настройки и не накапливают погрешности в циклических срабатываниях.\n\n### Основные возможности и преимущества:\n- **Точность работы без накопления ошибок.**\\\n  При каждом срабатывании таймера учитывается разница между запланированным и фактическим временем выполнения.\n- **Настраиваемое количество срабатываний.**\\\n  Возможность задать количество срабатываний, например, чтобы таймер отработал 10 раз с интервалом в одну секунду и затем остановился.\n- **Выбор игрового цикла для выполнения.**\\\n Таймер может работать в Update, FixedUpdate и других циклах.\n- **Пользовательская функция времени.**\\\n Возможность использовать собственную функцию времени вместо стандартных Time.time, Time.deltaTime и других.\n- **Многократные срабатывания за один кадр.**\\\n При малых интервалах времени таймер может вызывать события несколько раз за один кадр.\n- **Безопасный многократный запуск и остановка.**\\\n Таймер остается стабильным при многократных вызовах Start() и Stop() в пределах одного кадра\n- **Изменение параметров на лету.**\\\n Интервал, количество срабатываний и другие параметры могут быть изменены в процессе работы таймера.\n- **Простота сохранения и копирования.**\\\n Внутренние параметры таймера, такие как прошедшее время и количество срабатываний, доступны для сохранения и создания копий.\n\n\u0026nbsp;\n# 2. Таймера:\n\n## 1. DeltaTimeTimer:\n- Использует разницу времени между кадрами для своих расчётов (Time.deltaTime и другие).\n- При остановке и последующем запуске продолжает работу без учета времени, когда таймер был остановлен.\n  \n### Создание\n``` csharp\npublic static DeltaTimeTimer Create( float interval, int loopCount, InvokeMode invokeMode, bool unscaledTime, PlayerLoopTiming playerLoopTiming) \n```\n- ```interval``` - Интервал времени, по истечению которого таймер вызывает событие ```Elapsed```.\\\n- ```loopCount``` - Количество раз, которое таймер должен вызвать событие ```Elapsed```. ```-1``` - бесконечный режим работы таймера.\\\n- ```invokeMode``` - Определяет, может ли таймер вызывать событие ```Elapsed``` несколько раз за один кадр или только один раз.\\\n- ```unscaledTime``` - Указывает, использовать ли ```Time.unscaledDeltaTime``` или ```Time.deltaTime``` для расчета времени.\\\n- ```playerLoopTiming``` - Определяет, в каком из игровых циклов (например, ```Update```, ```FixedUpdate``` и т.д.) будет использоваться таймер.\n\n``` csharp\npublic static DeltaTimeTimer Create( float interval, Func\u003cfloat\u003e getDeltaTime, int loopCount, InvokeMode invokeMode, PlayerLoopTiming playerLoopTiming)\n```\n- ```getDeltaTime``` - пользовательская функция, возвращающая интервал между текущим и предыдущим кадром.\n\n### Свойства\n\n#### Data\nСодержит все рабочие параметры таймера.\n- ```ElapsedTime``` - Время с момента запуска или последнего срабатывания таймера.\n- ```Interval``` - Интервал времени, по истечению которого таймер вызывает событие ```Elapsed```.\n- ```CompletedTicks``` - Текущее количество срабатываний таймера.\n- ```TotalTicks``` - Количество раз сколько должен сработать таймер. -1 - бесконечный режим работы таймера.\n\n#### TickData\nСодержит информацию о последнем срабатывании таймера. Если таймер может сработать несколько раз в пределах одного кадра, это свойство позволяет определить количество вызовов события и их порядок.\n- ```TicksPerFrame``` - Количество срабатываний таймера в пределах одного кадра.\n- ```TickNumber``` - Порядковый номер срабатывания таймера в режиме ```InvokeMode.Multi```; всегда 0 в режиме ```InvokeMode.Single```.\n\n\u0026nbsp;\n## 2. RealtimeTimer \n- Использует игровое время (Time.time и другие или пользовательскую функцию времени).\n- При остановке и последующем запуске вызываются все пропущенные срабатывания.\n- В случае многократных срабатываний в пределах одного кадра, таймер позволяет точно определить время каждого срабатывания, используя свойство Date.Time.\n### Создание\n``` csharp\npublic static RealtimeTimer Create(float interval, int loopsCount, InvokeMode invokeMode, RealtimeMode timeMode, PlayerLoopTiming playerLoopTiming)\n```\n- ```interval``` - Интервал времени, по истечению которого таймер вызывает событие ```Elapsed```.\\\n- ```loopCount``` - Количество раз, которое таймер должен вызвать событие ```Elapsed```. ```-1``` - бесконечный режим работы таймера.\n- ```invokeMode``` - Определяет, может ли таймер вызывать событие ```Elapsed``` несколько раз за один кадр или только один раз.\n- ```timeMode``` - Указывает тип используемого времени : ```Time.unscaledTime```, ```Time.time``` или ```Time.realtimeSinceStartup```.\n- ```playerLoopTiming``` - Определяет, в каком из игровых циклов (например, ```Update```, ```FixedUpdate``` и т.д.) будет использоваться таймер.\n\n``` csharp\npublic static RealtimeTimer Create(float interval, Func\u003cfloat\u003e getTime, int loopsCount, InvokeMode invokeMode, PlayerLoopTiming playerLoopTiming)\n```\n- ```getTime``` - Пользовательская функция, возвращающая текущее игровое время.\n\n### Свойства\n#### Data\nСодержит все рабочие параметры таймера.\n- ```LastTime``` - Время последнего срабатывания таймера или время его запуска.\n- ```Interval``` - Временной интервал, по истечению которого таймер генерирует событие ```Elapsed```.\n- ```CompletedTicks``` - Текущее количество срабатываний таймера\n- ```TotalTicks``` - Общее количество срабатываний таймера до его остановки. Значение -1 указывает на бесконечный режим работы.\n\n#### TickData\nСодержит информацию о последнем срабатывании таймера. Если таймер может сработать несколько раз в пределах одного кадра, это свойство позволяет определить количество вызовов события и их порядок.\n- ```TicksPerFrame``` - Количество срабатываний таймера в пределах одного кадра;\n- ```TickNumber``` - Порядковый номер срабатывания таймера в режиме ```InvokeMode.Multi```; всегда 0 в режиме ```InvokeMode.Single```;\n\n\u0026nbsp;\n## 3. DateTimeTimer \n- Использует системное время (DateTime.Now или пользовательскую функцию).\n- При остановке и последующем запуске вызываются все пропущенные срабатывания.\n- В случае многократных срабатываний в пределах одного кадра, таймер позволяет точно определить время каждого срабатывания, используя свойство Date.Time.\n  \n### Создание\n``` csharp\npublic static DateTimeTimer Create(TimeSpan interval, int loopsCount, InvokeMode invokeMode, PlayerLoopTiming playerLoopTiming)\n```\n- ```interval``` - Интервал времени, по истечению которого таймер вызывает событие ```Elapsed```.\\\n- ```loopCount``` - Количество раз, которое таймер должен вызвать событие ```Elapsed```. ```-1``` - бесконечный режим работы таймера.\\\n- ```invokeMode``` - Определяет, может ли таймер вызывать событие ```Elapsed``` несколько раз за один кадр или только один раз.\\\n- ```playerLoopTiming``` - Определяет, в каком из игровых циклов (например, ```Update```, ```FixedUpdate``` и т.д.) будет использоваться таймер.\n\n``` csharp\npublic static DateTimeTimer Create(TimeSpan interval, Func\u003cDateTime\u003e getTime, int loopsCount, InvokeMode invokeMode, PlayerLoopTiming playerLoopTiming)\n```\n- ```getTime``` - Пользовательская функция, возвращающая текущее системное время.\n\n\u0026nbsp;\n# 3. Использование\nПример таймера, который срабатывает каждую секунду и останавливается после 10 срабатываний.\n``` csharp\n    float interval = 1f;\n    int loopCount = 10;\n    Func\u003cfloat\u003e getTime = GameWorldTime.GetTime;\n    InvokeMode invokeMode = InvokeMode.Multi;\n    \n    // Create timer\n    var timer = RealtimeTimer.Create(interval, getTime, loopCount, invokeMode);\n    \n    timer.Elapsed += () =\u003e { Debug.Log($\"Elapsed at realtime {Time.time}. Calculate time - {timer.Data.LastTime}\"); };\n    timer.Started += () =\u003e Debug.Log(\"Timer started\");\n    timer.Stopped += () =\u003e Debug.Log(\"Timer stopped\");\n    timer.Completed += () =\u003e Debug.Log(\"Tier finished\");\n    \n    // Start or resume the timer\n    timer.Start();\n    \n    // Modify timer properties\n    timer.Data.Interval = interval * 2;\n    timer.Data.LastTime = GameWorldTime.GetTime() + 10;\n    \n    // Stop the timer, with the ability to resume.\n    timer.Stop();\n    \n    // Stop and reset the timer\n    timer.Reset();\n```\n\n## InvokeMode\nЕсли интервал срабатывания таймера меньше, чем интервал времени между кадрами, то этот параметр определяет как таймер будет вызывать событие.\n### InvokeMode.Multi\nВ этом режиме событие `Elapsed` будет вызываться несколько раз в течении одного кадра. Свойство `TickData` позволяет получить информацию о количестве срабатываний таймера за кадр и номер текущего события.\n``` csharp\n    float interval = 0.005f;\n    int loopCount = 5;\n    \n    var timer = DeltaTimeTimer.Create(interval, loopCount, invokeMode: InvokeMode.Multi);\n    timer.Started += ()=\u003e Debug.Log($\"Timer started at {Time.time}\");\n    timer.Completed += () =\u003e Debug.Log($\"Timer finished at {Time.time}\");\n    timer.Elapsed += () =\u003e Debug.Log($\"Current time - {Time.time}. Scheduled time - {timer.Data.LastTime}. Ticks - {timer.TickData.TickNumber + 1}/{timer.TickData.TicksPerFrame}\");\n\n    timer.Start();\n```\nВывод\n```\n  Timer started at 19,02731\n  Current time - 19,03973. Scheduled time - 19,03231. Ticks - 1/2\n  Current time - 19,03973. Scheduled time - 19,03731. Ticks - 2/2\n  Current time - 19,05369. Scheduled time - 19,04231. Ticks - 1/3\n  Current time - 19,05369. Scheduled time - 19,04731. Ticks - 2/3\n  Current time - 19,05369. Scheduled time - 19,05231. Ticks - 3/3\n  Timer finished at 19,05369\n```\n### InvokeMode.Single\nВ этом режиме событие `Elapsed` будет вызываться один раз в течении одного кадра. Свойство `TickData` позволяет получить информацию только о коичестве срабатываний таймера.\n``` csharp\n    float interval = 0.005f;\n    int loopCount = 5;\n    \n    var timer = DeltaTimeTimer.Create(interval, loopCount, invokeMode: InvokeMode.Single);\n    timer.Started += ()=\u003e Debug.Log($\"Timer started at {Time.time}\");\n    timer.Completed += () =\u003e Debug.Log($\"Timer finished at {Time.time}\");\n    timer.Elapsed += () =\u003e Debug.Log($\"Current time - {Time.time}. Ticks - {timer.TickData.TicksPerFrame}\");\n\n    timer.Start();\n```\nВывод\n```\n  Timer started at 19,02731\n  Current time - 19,03973. Ticks - 2\n  Current time - 19,05369. Ticks - 3\n  Timer finished at 19,05369\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatcodegames%2Fintervaltimers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatcodegames%2Fintervaltimers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatcodegames%2Fintervaltimers/lists"}