mmm-0.1.0.0: Minecraft 1.21.4 implementation in Haskell
Copyright(c) axionbuster 2025
LicenseBSD-3-Clause
Safe HaskellNone
LanguageGHC2021

M.IO.Tick

Description

This module provides functionality for running actions at controlled intervals with adaptive timing adjustments.

Synopsis
  • tick :: forall (es :: [Effect]) b. (IOE :> es, Concurrent :> es) => TVar Double -> Eff es () -> Eff es b

Timing Control

tick Source #

Arguments

:: forall (es :: [Effect]) b. (IOE :> es, Concurrent :> es) 
=> TVar Double

Target frequency in Hz (stored in TVar)

-> Eff es ()

Action to execute periodically

-> Eff es b 

Executes an action periodically with adaptive timing control.

The function ensures the action runs at a target frequency by adjusting delays between executions based on execution time.

tick ratevar action    -- Runs 'action' at frequency specified by rateVar (in Hz)