private void TimerCallback(object state) { Device.BeginInvokeOnMainThread(() => { OnTimerTick?.Invoke(); }); }
private void CheckTimerTick() { if (!enableTick || !(CurrentTime > _timeLastTick + tickTime)) { return; } OnTimerTick?.Invoke(); _timeLastTick = CurrentTime; }
private IEnumerator Counter() { while (true) { currentTime += timeOfTick; OnTimerTick?.Invoke(currentTime); text.text = currentTime.ToString(); yield return new WaitForSeconds(timeOfTick); } }
private void Tick() { currentTime -= Time.deltaTime; if (currentTime <= 0) { currentTime = 0; OnTimerEnd?.Invoke(); } OnTimerTick?.Invoke(currentTime); }
private async void GatherData() { //var r = await GetData(); //if (r.Success) //{ //OnTimerTick?.Invoke(r.Temperature,r.Humidity); //} while (CollectData) { CreateRandomData(out var temp, out var hum); OnTimerTick?.Invoke(temp, hum); await Task.Delay(TimerInSeconds * 1000); } }
protected override void Update() { if (IsRunning) { RemainingTime = System.Math.Max(0, RemainingTime - Application.Time.DeltaTime); OnTimerTick?.Invoke(this); if (RemainingTime == 0) { IsRunning = false; OnTimerComplete?.Invoke(this); } } }
public override void Update(float deltaTime) { if (IsRunning) { RemainingTime = Math.Max(0, RemainingTime - deltaTime); OnTimerTick?.Invoke(this); if (RemainingTime == 0) { IsRunning = false; OnTimerComplete?.Invoke(this); } } }
public void Tick(float deltaTime) { if (_paused || _elapsed) { return; } _timeLeft -= deltaTime; OnTimerTick?.Invoke(_timeLeft); if (!_elapsed && _timeLeft < 0) { _elapsed = true; OnTimerElapsed?.Invoke(); } }
private IEnumerator TimerCoroutine(float time) { TimeLeft = 0.0f; while (true) { yield return(new WaitForSeconds(0.2f)); TimeLeft += 0.2f; OnTimerTick?.Invoke(time - TimeLeft); if (TimeLeft >= time) { SendStatistics(false, "Время истекло"); break; } } }
private void m_timer1_Tick(object sender, EventArgs e) { //Debug.WriteLine("Timer: " + DateTime.Now.ToString("s")); if (m_Options == null) { return; } m_timer1.Stop(); //if (Loop && m_Mp3Player.GetStatusMode() == NETSoundPlayer.PlayingState.stopped && m_trackBarPosition.Value == m_trackBarPosition.Maximum) // Play(m_playLists.PL.NextIdx()); OnTimerTick?.Invoke(sender, e); UpdateInfo(); m_timer1.Start(); }
void Tick(object sender, EventArgs e) { if (StaticOnTimerTick != null) { StaticOnTimerTick.Invoke(this, new EventArgs()); } if (OnTimerTick != null) { OnTimerTick.Invoke(this, new EventArgs()); } if (Value >= Maximum) { if (cof && this.ParentForm != null) { this.ParentForm.Close(); } } }
private void Timer_Tick(object sender, EventArgs e) { timer.Stop(); OnTimerTick.Invoke(); timer.Start(); }