|
-
Jun 14th, 2004, 03:10 AM
#1
Thread Starter
Frenzied Member
Time and subtraction
I am testing performance and comparing time consumptions in Java and .net and for this I need to calculate in milliseconds. My timestamps are:
time1 = Now.Hour & ":" & Now.Minute & ":" & Now.Second & ":" & Now.Millisecond
when the calculation begins and
time2 = Now.Hour & ":" & Now.Minute & ":" & Now.Second & ":" & Now.Millisecond
How do I subtract the two times when I need milliseconds?
-
Jun 14th, 2004, 05:33 AM
#2
PowerPoster
Re: Time and subtraction
Originally posted by hpl
I am testing performance and comparing time consumptions in Java and .net and for this I need to calculate in milliseconds. My timestamps are:
time1 = Now.Hour & ":" & Now.Minute & ":" & Now.Second & ":" & Now.Millisecond
when the calculation begins and
time2 = Now.Hour & ":" & Now.Minute & ":" & Now.Second & ":" & Now.Millisecond
How do I subtract the two times when I need milliseconds?
Try
VB Code:
Dim Time1, time2 As DateTime
Dim icount, tCount As Integer
Time1 = Now
For icount = 1 To 10000
TextBox1.Text = Val(icount)
Next
time2 = Now
tCount = time2.Subtract(Time1).Milliseconds()
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Jun 14th, 2004, 06:00 AM
#3
Thread Starter
Frenzied Member
Thanks a lot, it works fine!
-
Jun 14th, 2004, 06:23 AM
#4
PowerPoster
Originally posted by hpl
Thanks a lot, it works fine!
You're welcome.
Edit your first post and add "[Resolved]" to the thread title.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
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
|