|
-
Jul 14th, 2005, 08:16 AM
#1
Thread Starter
Hyperactive Member
A Stop WAtch
Hi!
I am developing an application in asp.net with c# as the codebehind. I have to determine, how long (time) did it take for a particular piece of code to execute. How to achieve this?
-
Jul 14th, 2005, 01:48 PM
#2
PowerPoster
Re: A Stop WAtch
Well, not sure if this is what you want
am posting in VB.NET
Code:
Private Function DoSomething()
dim dtStartTime as date = now
dim i as integer
For i = 0 to 100000
'Do something here
Next
dim dtEndTime as date = now
'The difference bewteen the end time and start time would tell you how much time it took your code to execute.
ENd Function
-
Jul 15th, 2005, 08:37 AM
#3
Thread Starter
Hyperactive Member
Re: A Stop WAtch
Thanks a ton.
I want to make a class of this, so that it can be used anywhere by creating an instance of it and calling its function.
Now, shall I have two properties for starttime and endtime and one function to calculate the difference.
Can you just give me a sample code. I am a newbie as my background was vb/asp..and I have to jump to the .net world.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|