View Single Post
  #1   Spotlight this post!  
Unread 21-01-2007, 22:25
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 6,998
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
CPU Load in FRC RC

It has been years - no, decades - since my last programming class. (We used punchcards, if that's a clue...).

My question has to do with the relative load on the CPU for the various programmatical operations that can be performed. I was always under the impression that an IF statement took a lot more CPU time than a series of 3 or 4 simple additions - but a thread near here made me re-think that belief.

So, can anyone explain to me the load on the CPU of the various operations, particularly Math (integer and quasi-floating [bit shifts?], if there's any difference), Logical comparisons (<=), Conditionals, and I/O statements (and what else did I miss?).

Also, my assumption is that if I do a certain calculation, it takes as long to do it in a 'subroutine' (or whetever we call them today - a called function?) as it would in the main programming loop. (Ignore proper programming practice, I'm only worried about CPU load)

Not looking for exact numbers, a relative comparison would be fine. Even better would be a reference where I could just read on it myself...

Thanks,
Don
__________________

I am N2IRZ - What's your callsign?