English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

So basically, how long is the execution time or time needed to execute an operator?

+ (Addition)
- (Subtraction)
* (Multiplication)
/ (Real Division)
\ (Integer Division)
Mod (Modulus)
= (Assignment)

Also, if you know: Math (Math.Sin, Math.Pow, etc)

Also, some other common operators I might've missed.

2006-10-20 07:41:11 · 1 answers · asked by Lie Ryan 6 in Computers & Internet Programming & Design

1 answers

I couldn't find any explicit information about it, but it is an interesting question. Note, of course, that this question would be the same for any .NET language (VB.NET, C#, J#, etc.), because the actual operation would be done in the CLR, independant of language.

From MSDN, the following links would probably be useful to you:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/fastmanagedcode.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/highperfmanagedapps.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetperftips.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetgcbasics.asp

I recommend an empirical approach. Create a little app which performs a simple operation (e.g. addition, subtraction, etc.) repeatedly and exclusively a large number of times. Increasing the number of times you perform the operation and the number of times you do the trials will statistically give you better results.

Do the tests for each operation you want to analyze. For easy timing, I recommend using the System.Diagnostics.Stopwatch class.

2006-10-20 08:16:23 · answer #1 · answered by freddrick_flintstone 3 · 0 0

fedest.com, questions and answers