Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1946
  • Last Modified:

Getting milliseconds in VBScript.

How can I show the current time (including milliseconds) in VBScript?  

I know how to show the current time using "date" and "FormatDateTime," but not to the granularity of milliseconds.

-John
0
tbjonap
Asked:
tbjonap
  • 3
1 Solution
 
HMWTCommented:
you can retrive it like this:
(cint(timer*100)/100)
I'v never used VBScript but:
time$ & "." & (cint(timer*100) mod 100)
should return
"hh:mm:ss.ms"
in reg VB

0
 
mark2150Commented:
No point in showing time to mS resolution as internal timer tick is only 18.2Hz or about 55mS. You can show as many decimal places to the right of the seconds as you want, only the first two will be significant.

M

0
 
HMWTCommented:
my sugestion only is to show it to 2 decimal places. but you could show it to more or less as you see fit by just adding or removing a '0' to both 100's.
0
 
HMWTCommented:
my sugestion only is to show it to 2 decimal places. but you could show it to more or less as you see fit by just adding or removing a '0' to both 100's.

Have Mouse Will Travel
0
 
tbjonapAuthor Commented:
Thanks HMWT.  Enjoy your 100 points.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now