Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleCompare the speeds of different calculations
Keywordscalculation, multiplication, division, speed, time, performance
CategoriesAlgorithms, Tips and Tricks
 
This program performs a series of calculations to compare the speed of division, multiplication, and integer division using Single, Double, Integer, and Long data types.

Dividing integers and longs using \ is faster than using /. Multiplying by 0.5 is faster than dividing by 2.

On my computer, the Long data type is faster than the Integer type. Single and Double are even faster. This probably depends on your CPU.

Note that the differences are small so you should not change the way you perform calculations if it makes the code less clear.

 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated