View Single Post
  #7   Spotlight this post!  
Unread 02-06-2010, 15:06
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Porting to Java: enums, clocks, and multi-files

Quote:
Originally Posted by JesseK View Post
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
Reply With Quote