Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
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-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated