Re: Calculate time difference in mini-second with VBScript
- From: "Paul Randall" <paulr901@xxxxxxxxxxxx>
- Date: Mon, 29 Jan 2007 09:59:52 -0700
"Eric Wu" <wugh@xxxxxxxxxxxxxx> wrote in message
news:OLlsnH0QHHA.1200@xxxxxxxxxxxxxxxxxxxxxxx
Hi All,Hi,
I have two questions. First, we wrote a script to monitor file server
response time. But datediff() function can only calculate time difference
in
seconds. We are asked to provide data in mini-second. Is this possible in
VBScript? Or, i have to use vb.net?
2nd question, we wrote a script to list file service connection
information on a fie server, then try to check virus defination file on
connected client using WMI. But some of this client is not in our domain.
When this occurs, the script tale very long time to retry. Is is possible
to
set a timeout value before create a wmi connection?
Thank you very much for your time and any help.
Eric Wu
I can't help with your second question.
On the timer question, plain VBScript does not have a way to access time
with less than 1 second resolution. The windows OS has timers with very
high resolution, but VBScript cannot directly get to them. There are free
COM objects that can access a higher resolution timer. One, called ASPTime,
is avalable here: http://www.cs.niu.edu/%7Ez951259/comlinks.html.
The Windows timer used by ASPTime has a variable resolution. On NT-type
systems ( for example, W2K & newer), it defaults to 10 milliseconds, but can
be as high as 1 millisecond, depending on the highest resolution currently
being used by any running application. So the trick is to guarantee its
being at 1 millisecond by running some little application, like running a
tiny HTML file with just this in the body:
<body>
<bgsound src="ding.wav" loop=0>
</body>
The 'ding' lasts under a second, but until you close this HTML file, the
sound software's request for 1 millisecond resolution remains in effect, so
ASPTime can get this resolution.
-Paul Randall
.
- Follow-Ups:
- Re: Calculate time difference in mini-second with VBScript
- From: Bob O`Bob
- Re: Calculate time difference in mini-second with VBScript
- References:
- Calculate time difference in mini-second with VBScript
- From: Eric Wu
- Calculate time difference in mini-second with VBScript
- Prev by Date: Re: VBScript Parsing XML Question
- Next by Date: Re: If Then Exit Do
- Previous by thread: Re: Calculate time difference in mini-second with VBScript
- Next by thread: Re: Calculate time difference in mini-second with VBScript
- Index(es):
Relevant Pages
|
Loading