Solved

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

Posted on 2001-06-12
9
379 Views
Last Modified: 2010-05-02
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.
0
Comment
Question by:prabath
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 15

Expert Comment

by:robbert
ID: 6184591
sngStartTime = Timer

' do stuff

Response.Write Timer - sngStartTime ' 1.23235355 seconds
0
 
LVL 15

Accepted Solution

by:
robbert earned 10 total points
ID: 6184595
Oh, that was ASP. VB:

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

Expert Comment

by:robbert
ID: 6184633
Additionally,

lngMilliSecondsElapsed = DateDiff("s", Now, "1/1/1970") * 1000
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 6

Expert Comment

by:andyclap
ID: 6190132
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
 
LVL 49

Expert Comment

by:DanRollins
ID: 7136003
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
 
LVL 1

Expert Comment

by:Computer101
ID: 7169184
Comment from expert accepted as answer

Computer101
E-E Moderator
0
 
LVL 1

Expert Comment

by:alldata
ID: 24044936
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
 
LVL 6

Expert Comment

by:andyclap
ID: 24053222
seven years!
0
 
LVL 1

Expert Comment

by:alldata
ID: 24062901
Whoa...sorry! I didn't look at the timestamp...
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month7 days, 15 hours left to enroll

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question