Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
What are the "weight" of VB.NET's operators?
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.
1 Answer
- 1 decade agoFavorite Answer
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=...
http://msdn.microsoft.com/library/default.asp?url=...
http://msdn.microsoft.com/library/default.asp?url=...
http://msdn.microsoft.com/library/default.asp?url=...
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.