Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default My macros are slowing down.

Very sorry, the link was incorrect ... A very unlucky search for my
³speedtype.xls² file found something totally useless (... To me anyway) ...

I can¹t find where I got it now ... The code in the macro was as follows ...

Sub Test()

Dim t As Single

Dim tByte0 As Byte, tByte1 As Byte, tByte2 As Byte, tByte3 As Byte
Dim tInt0 As Integer, tInt1 As Integer, tInt2 As Integer, tInt3 As Integer
Dim tLong0 As Long, tLong1 As Long, tLong2 As Long, tLong3 As Long
Dim tSingle0 As Single, tSingle1 As Single, tSingle2 As Single, tSingle3 As
Single
Dim tDouble0 As Double, tDouble1 As Double, tDouble2 As Double, tDouble3 As
Double
Dim tVariant0 As Variant, tVariant1 As Variant, tVariant2 As Variant,
tVariant3 As Variant

'clear
Range("b3:b8").ClearContents

'test byte
t = Timer
For tByte0 = 1 To 254
For tByte1 = 1 To 254
For tByte2 = 1 To 254
tByte3 = (tByte2 + tByte1 / tByte0) Mod 200
Next tByte2
Next tByte1
Next tByte0
t = Timer - t
Cells(3, 2) = t

'test integer
t = Timer
For tInt0 = 1 To 254
For tInt1 = 1 To 254
For tInt2 = 1 To 254
tInt3 = (tInt2 + tInt1 / tInt0) Mod 200
Next tInt2
Next tInt1
Next tInt0
t = Timer - t
Cells(4, 2) = t

'test long
t = Timer
For tLong0 = 1 To 254
For tLong1 = 1 To 254
For tLong2 = 1 To 254
tLong3 = (tLong2 + tLong1 / tLong0) Mod 200
Next tLong2
Next tLong1
Next tLong0
t = Timer - t
Cells(5, 2) = t

'test single
t = Timer
For tSingle0 = 1 To 254
For tSingle1 = 1 To 254
For tSingle2 = 1 To 254
tSingle3 = (tSingle2 + tSingle1 / tSingle0) Mod 200
Next tSingle2
Next tSingle1
Next tSingle0
t = Timer - t
Cells(6, 2) = t

'test doublw
t = Timer
For tDouble0 = 1 To 254
For tDouble1 = 1 To 254
For tDouble2 = 1 To 254
tDouble3 = (tDouble2 + tDouble1 / tDouble0) Mod 200
Next tDouble2
Next tDouble1
Next tDouble0
t = Timer - t
Cells(7, 2) = t

'test variant
t = Timer
For tVariant0 = 1 To 254
For tVariant1 = 1 To 254
For tVariant2 = 1 To 254
tVariant3 = (tVariant2 + tVariant1 / tVariant0) Mod 200
Next tVariant2
Next tVariant1
Next tVariant0
t = Timer - t
Cells(8, 2) = t

End Sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linked cells slowing me down? Elizabeth Excel Discussion (Misc queries) 7 August 1st 07 01:08 PM
excel 2003 slowing down Ron Excel Discussion (Misc queries) 0 October 19th 06 03:22 PM
Excel slowing down during usage cbernad Excel Discussion (Misc queries) 3 August 18th 06 08:01 PM
slowing down nowfal Excel Discussion (Misc queries) 3 March 29th 06 01:33 AM
My macros are slowing down. Brad Patterson Excel Programming 0 July 23rd 03 11:59 PM


All times are GMT +1. The time now is 09:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"