How to get the time lapsed from 1970 Jan midnight in milliseconds?

Hi all,
   
     I want to calculate the response time for a particular request.WebBrowser component is used in my appln.It has two methods(DownloadBegin,DownLoadComplete and DocumentComplete).I need to get the time in milliseconds when the downloadBegin and DownloadComplete called.

    How to get the time in milliseconds in VB 6.0? Is there any methods like CurrentTimeMillis in JAVA(It will return a long which contains the time lapsed in milliseconds from 1970 Jan midnight to current time).
               Thanks in advance.
Prabath.
prabathAsked:
Who is Participating?
 
robbertConnect With a Mentor Commented:
Oh, that was ASP. VB:

Dim sngStartTime As Single
sngStartTime = Timer
' do stuff
Debug.Print Timer - sngStartTime ' 1.23235355 seconds
0
 
robbertCommented:
sngStartTime = Timer

' do stuff

Response.Write Timer - sngStartTime ' 1.23235355 seconds
0
 
robbertCommented:
Additionally,

lngMilliSecondsElapsed = DateDiff("s", Now, "1/1/1970") * 1000
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
andyclapCommented:
The resolution of the standard time/timer/date objects is not millisecond accurate (about 19ms is it's finest resolution).

You could look at using multimedia timers which can have millisecond precision, if you really need this.

Have a look at
http://pages.about.com/vbmakai/st1.htm
for a sample project which uses these timers.
0
 
DanRollinsCommented:
Hi prabath,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept robbert's comment(s) as an answer.

prabath, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
Computer101Commented:
Comment from expert accepted as answer

Computer101
E-E Moderator
0
 
alldataCommented:
In Robbert's code snippet the date values where backwards so it was returning a negative value.

Wrong:
lngMilliSecondsElapsed = DateDiff("s", Now, "1/1/1970") * 1000

Right:
lngMilliSecondsElapsed = DateDiff("s", "1/1/1970", Now) * 1000

No biggie, just thought I would save someone the hassle of figuring this out.
0
 
andyclapCommented:
seven years!
0
 
alldataCommented:
Whoa...sorry! I didn't look at the timestamp...
0
All Courses

From novice to tech pro — start learning today.