This commit is contained in:
TinyHerm committed 2026-11-24 23:40:08 +03:00
commit 1c7a8cf25f
579 files changed
+83196

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
using System;
namespace VibranceHud.Zoom;
internal sealed class TimedProbe
{
private readonly Func<bool> _probe;
private readonly Func<long> _nowMs;
private readonly long _ttlMs;
private bool _value;
private long _at;
private bool _have;
public TimedProbe(Func<bool> probe, Func<long> nowMs, long ttlMs)
{
_probe = probe;
_nowMs = nowMs;
_ttlMs = ttlMs;
}
public bool Get()
{
long num = _nowMs();
if (_have && num - _at < _ttlMs)
{
return _value;
}
_value = _probe();
_at = num;
_have = true;
return _value;
}
}