private static extern uint timeSetEvent( uint uDelay, uint uResolution, LpTimeProcDelegate lpTimeProc, int dwUser, TimerMode fuEvent );
public MultimediaTimer(Action <object> callback, object state, int period) { if (period <= 0) { throw new ArgumentOutOfRangeException(nameof(period), "Period must be greater than 0"); } _callback = callback; _state = state; _lpTimeProc = CallbackInternal; _eventId = timeSetEvent((uint)period, 1, _lpTimeProc, 0, TimerMode.Periodic); }
public void Dispose() { _lpTimeProc = default; timeKillEvent(_eventId); }