View Single Post
  #4   Spotlight this post!  
Unread 28-02-2013, 13:29
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,588
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Comparing performance of two sets of code

Quote:
Originally Posted by BigJ View Post
Another alternative would be to check the difference of the system time between the start and end of each Periodic method. We use Command-based architecture in Java (System.currentTimeMillis() is available), so I'm not sure if running the Command-based Scheduler happens in a separate thread (which would make this solution incorrect).
The command scheduler does not run in a different thread, so this is a good approach.

Quote:
Originally Posted by BigJ View Post
We are also not sure what kind of times would indicate a bad difference in performance. The FMS whitepaper and DS Log guide indicate that a trip time above 20ms is undesirable. If we were able to log the loop time in code, assuming we haven't changed any settings about how fast the periodic loop runs, what would be an acceptable range of computation time?
The 20ms time is because that is how often the driver station sends new data. If your code takes longer then 20ms to run, it will miss packets from the driver station.