diff --git a/Devices/Generic/AbstractCueDevice.cs b/Devices/Generic/AbstractCueDevice.cs index 381386b..499b591 100644 --- a/Devices/Generic/AbstractCueDevice.cs +++ b/Devices/Generic/AbstractCueDevice.cs @@ -64,6 +64,7 @@ namespace CUE.NET.Devices.Generic private CancellationTokenSource _updateTokenSource; private CancellationToken _updateToken; private Task _updateTask; + private DateTime _lastUpdate = DateTime.Now; #endregion @@ -356,7 +357,9 @@ namespace CUE.NET.Devices.Generic { try { - Updating?.Invoke(this, new UpdatingEventArgs()); + long lastUpdateTicks = _lastUpdate.Ticks; + _lastUpdate = DateTime.Now; + Updating?.Invoke(this, new UpdatingEventArgs((float)((DateTime.Now.Ticks - lastUpdateTicks) / 10000000f))); } catch { diff --git a/Devices/Generic/EventArgs/UpdatingEventArgs.cs b/Devices/Generic/EventArgs/UpdatingEventArgs.cs index a8978b3..003d91f 100644 --- a/Devices/Generic/EventArgs/UpdatingEventArgs.cs +++ b/Devices/Generic/EventArgs/UpdatingEventArgs.cs @@ -1,5 +1,20 @@ namespace CUE.NET.Devices.Generic.EventArgs { public class UpdatingEventArgs : System.EventArgs - { } + { + #region Properties & Fields + + public float DeltaTime { get; } + + #endregion + + #region Constructors + + public UpdatingEventArgs(float deltaTime) + { + this.DeltaTime = deltaTime; + } + + #endregion + } }