Go to Post Andymark has everything! - nighterfighter [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 16-06-2014, 04:18
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 487
SoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant future
Re: Challenge problem: 'ladder of abstraction' iterative design in FRC

Quote:
Originally Posted by virtuald View Post
One reason I can think of is because if you artificially inflate the load to 100%, then when you have an *actual* load problem you won't notice it.
Certainly, if you've got the CPU pegged you have to look at some other metric to measure your performance. We just put everything together in one loop and used something like this:
Code:
class Perf_mon{
	Time start,last,worst_case_;
	unsigned iterations;

	public:
	Perf_mon():start(-1),last(-1),worst_case(0),iterations(0){}

	void update(Time t){
		if(last==-1){
			start=t;
		}else{
			auto elapsed=t-last;
			worst_case_=max(worst_case_,elapsed);
		}
		last=t;
		iterations++;
	}

	Time average()const{ return iterations/(.0001+start-last); }
	Time worst_case()const{ return worst_case_; }
};
And this was kind of overkill since we could just look at the worst case, notice it was much faster than the driver station data updated, and be done.
Closed Thread


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 01:51.

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