Spreadsheet Page Blog

 How Fast Is Your System?

Just for fun, take a few minutes and post your result. Copy and paste this procedure into a VBA module. Then run it, and post the time it takes.

Sub TimeTest()
  '100 million random numbers, tests, and math operations
  Dim x As Long
  Dim StartTime As Single
  Dim i As Long
  x = 0
  StartTime = Timer
  For i = 1 To 100000000
    If Rnd <= 0.5 Then x = x + 1 Else x = x - 1
  Next i
  MsgBox Timer - StartTime & " seconds"
End Sub

Here's the time on my system (no significant difference between Excel 2003, 2007, and 2010 Tech Preview):

My system is about three years old. I'm just curious about the range of processor speed of systems in use. Is it possible to run this in less than a second?

Permalink | Posted in General on 12 November, 2009 6:21pm

Search the Blog


Blog Posts Categories

Subscribe

© Copyright 2017, J-Walk & Associates, Inc.
Privacy Policy