Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
GeneralRe: Which one is faster - Static function calls or If else? Pin
leppie21-Apr-05 1:39
leppie21-Apr-05 1:39 
AnswerRe: Which one is faster - Static function calls or If else? Pin
Ashok Dhamija21-Apr-05 1:50
Ashok Dhamija21-Apr-05 1:50 
GeneralRe: Which one is faster - Static function calls or If else? Pin
Dave Kreskowiak21-Apr-05 2:38
mveDave Kreskowiak21-Apr-05 2:38 
GeneralRe: Which one is faster - Static function calls or If else? Pin
Ashok Dhamija21-Apr-05 18:57
Ashok Dhamija21-Apr-05 18:57 
GeneralRe: Which one is faster - Static function calls or If else? Pin
Dave Kreskowiak22-Apr-05 1:11
mveDave Kreskowiak22-Apr-05 1:11 
GeneralRe: Which one is faster - Static function calls or If else? Pin
Dave Kreskowiak22-Apr-05 9:16
mveDave Kreskowiak22-Apr-05 9:16 
GeneralRe: Which one is faster - Static function calls or If else? Pin
leppie21-Apr-05 6:18
leppie21-Apr-05 6:18 
GeneralRe: Which one is faster - Static function calls or If else? Pin
Ashok Dhamija21-Apr-05 18:19
Ashok Dhamija21-Apr-05 18:19 
In fact, I tried the aforesaid code with the floating point numbers also, by replacing the first lines of the code (above) with the following sample code:
float minValue;
float val1 = 5.3214F; 
float val2 = 7.7564F;

The result is still the same. The second method (i.e., the if-else method) is almost 100% faster than the first method (i.e., the Static Math method). The practical results on my machine were 17 seconds and 8 seconds respectively for 10 billion iterations for the said float numbers for the aforesaid two methods.

Regards
AnswerRe: Which one is faster - Static function calls or If else? Pin
Tom Larsen21-Apr-05 5:23
Tom Larsen21-Apr-05 5:23 
GeneralPlease help.... Pin
KORCARI21-Apr-05 0:42
KORCARI21-Apr-05 0:42 
GeneralMapInfo files... drawing map... Pin
yarns21-Apr-05 0:07
yarns21-Apr-05 0:07 
GeneralHelp -- AutoHide panels Pin
Umair Tariq20-Apr-05 22:45
Umair Tariq20-Apr-05 22:45 
GeneralRe: Help -- AutoHide panels Pin
Ashok Dhamija21-Apr-05 2:10
Ashok Dhamija21-Apr-05 2:10 
GeneralRe: Help -- AutoHide panels[Solved] Pin
Umair Tariq28-Apr-05 20:27
Umair Tariq28-Apr-05 20:27 
GeneralRe: Help -- AutoHide panels[Solved] Pin
erdem0122-Dec-08 3:20
erdem0122-Dec-08 3:20 
GeneralPainting Pin
Mark_Harrison20-Apr-05 22:16
Mark_Harrison20-Apr-05 22:16 
GeneralRe: Painting Pin
S. Senthil Kumar20-Apr-05 23:08
S. Senthil Kumar20-Apr-05 23:08 
GeneralRe: Painting Pin
Mark_Harrison20-Apr-05 23:40
Mark_Harrison20-Apr-05 23:40 
GeneralWebpages in Winforms[Solved] Pin
V.20-Apr-05 22:00
professionalV.20-Apr-05 22:00 
GeneralRe: Webpages in Winforms Pin
Umair Tariq20-Apr-05 22:49
Umair Tariq20-Apr-05 22:49 
GeneralRe: Webpages in Winforms Pin
V.20-Apr-05 23:13
professionalV.20-Apr-05 23:13 
GeneralRe: Webpages in Winforms[Solved] Pin
Kodanda Pani20-Apr-05 23:08
Kodanda Pani20-Apr-05 23:08 
GeneralRe: Webpages in Winforms[Solved] Pin
V.20-Apr-05 23:11
professionalV.20-Apr-05 23:11 
GeneralURGENT DATAGRID PROBLEM!!PLEASE HELP Pin
innocent7320-Apr-05 21:40
innocent7320-Apr-05 21:40 
GeneralIMPORTANT -- System.Reflection Pin
Den2Fly20-Apr-05 21:32
Den2Fly20-Apr-05 21:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.