Makes Java Timer timing more accurate

Java was using integer division for calulating Timer values, which
was causing Timer values to be concatinated, and only accurate
to the nearest millisecond. This changes it to use double division,
which matches C++ and makes timing much more accurate

Change-Id: I61b893f4ad5791bf4dfdd767ee4346c1ed4ea418
This commit is contained in:
Thad House
2016-02-09 19:29:57 -08:00
committed by Gerrit Code Review
parent fa8b68419f
commit e852547344
2 changed files with 6 additions and 6 deletions

View File

@@ -58,7 +58,7 @@ public class HardwareTimer implements Timer.StaticInterface {
}
class TimerImpl implements Timer.Interface {
private long m_startTime;
private double m_startTime;
private double m_accumulatedTime;
private boolean m_running;
@@ -70,8 +70,8 @@ public class HardwareTimer implements Timer.StaticInterface {
reset();
}
private long getMsClock() {
return Utility.getFPGATime() / 1000;
private double getMsClock() {
return Utility.getFPGATime() / 1000.0;
}
/**