From 081a2fc2bab396c889e4a1de3c5d9a12108431e9 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Tue, 20 Mar 2012 16:03:59 +0100 Subject: [PATCH] fixed calculating FPS --- Vocaluxe/Base/CUtility.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Base/CUtility.cs b/Vocaluxe/Base/CUtility.cs index ef4e94dd..909dc798 100644 --- a/Vocaluxe/Base/CUtility.cs +++ b/Vocaluxe/Base/CUtility.cs @@ -119,7 +119,7 @@ namespace Vocaluxe.Base { private static Stopwatch _Stopwatch = new Stopwatch(); private static float _fps = 0.0f; - private static long nanosecPerTick = (1000L * 1000L * 1000L) / Stopwatch.Frequency; + private static double nanosecPerTick = (1000.0 * 1000.0 * 1000.0) / Stopwatch.Frequency; public static void Reset() { @@ -149,7 +149,7 @@ namespace Vocaluxe.Base { long ticks = _Stopwatch.ElapsedTicks; if (Stopwatch.IsHighResolution && ticks != 0) - return (float)(((double)nanosecPerTick * (double)ticks) / (1000.0 * 1000.0)); + return (float)((nanosecPerTick * ticks) / (1000.0 * 1000.0)); else return (float)_Stopwatch.ElapsedMilliseconds; }