Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Time comparison

Hi all

I am trying to figure out what section of my code is running the longest.

how do i compare two times (ie subtract the two so that i can get a total
time run)

sub MyCode()
dim t1, t2, total
t1=time
<my code
t2=time

total=<how do i work with the time here
msgbox total
end sub

is this the correct way to do this or is there a better way?

and secondly is there a way to write one sub and have it triggered any time
that code is run, without putting a call to it in each of my functions?

basically i want to see how long each section of my code takes to run, so i
can see where the slowdowns are and possibly re-write, etc


tia!

J
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Time comparison

Hi,

t1=Timer( )
....
t2=Timer( )

total = t2-t1
--
Regards,
Sébastien


"Gixxer_J_97" wrote:

Hi all

I am trying to figure out what section of my code is running the longest.

how do i compare two times (ie subtract the two so that i can get a total
time run)

sub MyCode()
dim t1, t2, total
t1=time
<my code
t2=time

total=<how do i work with the time here
msgbox total
end sub

is this the correct way to do this or is there a better way?

and secondly is there a way to write one sub and have it triggered any time
that code is run, without putting a call to it in each of my functions?

basically i want to see how long each section of my code takes to run, so i
can see where the slowdowns are and possibly re-write, etc


tia!

J

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
Comparison TiffQ23 Excel Discussion (Misc queries) 1 February 18th 09 08:24 PM
XLS comparison Pick Excel Discussion (Misc queries) 1 May 26th 06 06:10 PM
Time comparison formula montagu Excel Discussion (Misc queries) 3 August 25th 05 03:37 PM
Time/Data Comparison SharonP Charts and Charting in Excel 2 February 3rd 05 05:43 AM
Comparison mike Excel Programming 2 February 2nd 04 09:10 PM


All times are GMT +1. The time now is 08:42 PM.

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"