Go to Post Anyone who makes a minibot that poots out another minibot that blows the wall apart deserves to have it displayed in the Smithsonian. - Koko Ed [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 20-01-2008, 21:15
evan_wilson's Avatar
evan_wilson evan_wilson is offline
QUARK
AKA: Evan Wilson
FRC #2172 (Street Legal)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Elyria, OH
Posts: 15
evan_wilson is an unknown quantity at this point
Send a message via AIM to evan_wilson Send a message via Yahoo to evan_wilson
Unhappy switch vs. if... else if. More efficient?

Greetings!

I'm programming the code for the CMUCam and serial interface right now and have just begun the portion where I determine the kind of data I am getting from the serial port buffer. I can imagine that this is an intensive process on the controller... so:

would it be more efficient to use a switch statement or an else... else if chain to determine what the next character in the buffer is?

I've read that a switch statement (out of many possibilities) would be more efficient because of compiler's ability to optimize the order of comparisons. But does this apply in the case of C18 2.4?

Thank you!
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Has Being In FIRST Made You More Brave - More Confident? JaneYoung General Forum 25 08-05-2007 10:11
Who else is... Jetgrindradio00 General Forum 2 03-03-2007 11:28
Get more women to SWITCH! Mikell Taylor General Forum 8 05-04-2006 23:30
Need Help Wiring Micro Switch/Limiting Switch Windward Electrical 2 07-02-2006 18:26
Most Efficient Big Ball Getter??? Team 384 archiver 2001 18 24-06-2002 02:39


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

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