|
Re: Porting to Java: enums, clocks, and multi-files
Quote:
Originally Posted by JesseK
2.) I'd recommend using System.currentTimeMillis() (or System.nanoTime() if it's supported in 1.3) as soon as the main() method is called and storing it in a globally accessible variable.
.
|
is this a reference? or would I still have to multiply? the code i'm working on is a timing function
Code:
public boolean CanSend()
{
return (this.lasttime+(1/this.currentHz)<=GetClock()) && this.IsAnyConnected();
}
public void ResetCounter()
{
this.lasttime=GetClock();
}
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
|