Go to Post We can not close our eyes, ears and minds from March to December. - Dave Campbell [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Spotlight this post!  
Unread 01-21-2013, 01:28 AM
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 152
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: SetSafetyEnabled() and SetExpiration()

If you really have a laggy problem and are trying to figure out what is taking all the time, there are a number of tactics to take. One tactic that can be helpful is getting quantitative values that show "how much time does this part take?" Without a good professional profiler, you can use the 'old school' method of timing...usually you will have a good sense of what's taking all the time - like vision code processing takes a lot of time. Get a value...

I'd suggest something like:
Code:
int loopstart, loopend, videostart, videoend;
while (IsOperatorControl())
{
  loopstart = GetUsClock(); // microseconds since startup

 [ code code code ]
  // start of vision code
  videostart = GetUsClock(); // microseconds since startup
  ProcessImage();
  videoend = GetUsClock(); // microseconds since startup
[ code code code ]
  loopend = GetUsClock(); // microseconds since startup
  SmartDashboard::PutNumber("LoopTime-ms", (loopend-loopstart)/1000);
  SmartDashboard::PutNumber("VideoTime-ms", (videoend-videostart)/1000);
  
}
The gist here is to get an idea of at least two things -- how long does it take you to loop the loop and how long does your "big possible offender" take to run? In SmartDashboard, you can have these values plotted as a graph rather than as just numbers "flitting" on the dashboard. That helps to see if you have consistent results or if your processing is for some reason sporatic.
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:23 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi