Skip to content

Commit 195010b

Browse files
author
Jan Nörtemann
committed
Clean up FromTicks
1 parent db2d1cd commit 195010b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Uml.Robotics.Ros.MessageBase/TimeData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public TimeSpan ToTimeSpan()
3232

3333
public static TimeData FromTicks(long ticks)
3434
{
35-
long seconds = (((long)Math.Floor(1.0 * ticks / TimeSpan.TicksPerSecond)));
35+
long seconds = (long)Math.Floor(ticks / (double)TimeSpan.TicksPerSecond);
3636
long nanoseconds = 100 * (ticks % TimeSpan.TicksPerSecond);
3737
return new TimeData((int)seconds, (int)nanoseconds);
3838
}

0 commit comments

Comments
 (0)