Skip to content

Commit

Permalink
account for drifting timer
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ober committed Aug 4, 2015
1 parent 01e6a9a commit ad30768
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private static void queryData(object source, ElapsedEventArgs e)
SmartTools.loadSmartData(disk, !fourBytes);
StringBuilder logstring = new StringBuilder();

logstring.Append((e.SignalTime - start_time).TotalSeconds.ToString(us)).Append(",");
logstring.Append((DateTime.Now - start_time).TotalSeconds.ToString(us)).Append(",");
logstring.Append(worker.GetWrittenMBytes().ToString(us)).Append(",");
logstring.Append(worker.GetPerformance().ToString(us)).Append(",");
logstring.Append(worker.GetInstPerformance().ToString(us)).Append(",");
Expand Down Expand Up @@ -343,7 +343,7 @@ static void Main(string[] args)
if (Console.KeyAvailable && Console.ReadKey(true).Key == ConsoleKey.Escape)
break;

if (howLong > 0 && (DateTime.Now - start_time).TotalMinutes > howLong)
if (howLong > 0 && Math.Floor((DateTime.Now - start_time).TotalSeconds) > howLong * 60)
break;

Thread.Sleep(100);
Expand Down

0 comments on commit ad30768

Please sign in to comment.