Hi

Trying to create a basic simple script to copy a file and see how long it
takes to copy the file.

Is this a way to compare the start and finish times I output from the Time
function and then display the result in seconds for how long it took to copy.

Code shown below


Thanks


Set objFSO = CreateObject("Scripting.FileSystemObject")
'WScript.StdOut.WriteLine ("Start Time: " & Time)
StartTime = Time
objFSO.CopyFile "S:\_TEMP_\clienttest\test", "C:\PC_MIG\Test\",
OverwriteExisting
FinishTime = Time
CopyOutput = "File Copy Test" &vbCRLf &vbCRLf
CopyOutput = CopyOutput & "[This Test should take no longer 10 Seconds]"
&vbCRLf &vbCRLf
CopyOutput = CopyOutput & "Test Started : " & StartTime &vbCRLf
CopyOutput = CopyOutput & "Test Finished : " & FinishTime &vbCRLf
WScript.Echo CopyOutput

Re: Comparing two time values for Difference by Steven

Steven
Thu Apr 07 11:46:53 CDT 2005

'// Time taken
Dim lStart, x
lStart =3D Timer()
For x =3D 1 to 5000
'// lalalalala
Next
WScript.Echo CDBL(FormatNumber(Timer() - lStart, 3)) & " seconds"

--=20
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Brian" <Brian@discussions.microsoft.com> wrote in message =
news:D097FD27-71E8-48B3-AACA-E52C288EC323@microsoft.com...
> Hi
>=20
> Trying to create a basic simple script to copy a file and see how long =
it=20
> takes to copy the file.
>=20
> Is this a way to compare the start and finish times I output from the =
Time=20
> function and then display the result in seconds for how long it took =
to copy.=20
>=20
> Code shown below
>=20
>=20
> Thanks
>=20
>=20
> Set objFSO =3D CreateObject("Scripting.FileSystemObject")
> 'WScript.StdOut.WriteLine ("Start Time: " & Time)
> StartTime =3D Time
> objFSO.CopyFile "S:\_TEMP_\clienttest\test", "C:\PC_MIG\Test\",=20
> OverwriteExisting
> FinishTime =3D Time
> CopyOutput =3D "File Copy Test" &vbCRLf &vbCRLf
> CopyOutput =3D CopyOutput & "[This Test should take no longer 10 =
Seconds]"=20
> &vbCRLf &vbCRLf
> CopyOutput =3D CopyOutput & "Test Started : " & StartTime &vbCRLf
> CopyOutput =3D CopyOutput & "Test Finished : " & FinishTime &vbCRLf
> WScript.Echo CopyOutput


Re: Comparing two time values for Difference by Dr

Dr
Thu Apr 07 17:35:12 CDT 2005

JRS: In article <D097FD27-71E8-48B3-AACA-E52C288EC323@microsoft.com>,
dated Thu, 7 Apr 2005 09:27:02, seen in news:microsoft.public.scripting.
vbscript, =?Utf-8?B?QnJpYW4=?= <Brian@discussions.microsoft.com> posted
:
>
>Is this a way to compare the start and finish times I output from the Time
>function and then display the result in seconds for how long it took to copy.

The answer that Stephen has given, while possibly helpful, does not
answer your actual question. Assuming that by "this" you mean "there",
the answer is "Yes"; and this is its proof :-

Ans = (FinishTime - StartTime) * 86400

Read <URL:http://www.merlyn.demon.co.uk/vb-dates.htm>.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

Re: Comparing two time values for Difference by Michael

Michael
Thu Apr 07 23:06:09 CDT 2005

Brian wrote:
> Hi
>
> Trying to create a basic simple script to copy a file and see how
> long it takes to copy the file.
>
> Is this a way to compare the start and finish times I output from the
> Time function and then display the result in seconds for how long it
> took to copy.

Google Groups : microsoft.public.windows.server.scripting
http://groups-beta.google.com/group/microsoft.public.windows.server.scripting/msg/9335fd52d1b8afc2

--
Michael Harris
Microsoft MVP Scripting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Please ask follow-up questions via the original newsgroup thread.




Re: Comparing two time values for Difference by Brian

Brian
Fri Apr 08 06:19:02 CDT 2005

Sorry for the Bad English I did mean "There"

As I am learning scripting any help is greatly appreciated

Thank you

I also found

TimeDifference = DateDiff("s", StartTime, FinishTime)
IF TimeDifference < 12 THEN
' WScript.Echo TimeDifference








"Dr John Stockton" wrote:

> JRS: In article <D097FD27-71E8-48B3-AACA-E52C288EC323@microsoft.com>,
> dated Thu, 7 Apr 2005 09:27:02, seen in news:microsoft.public.scripting.
> vbscript, =?Utf-8?B?QnJpYW4=?= <Brian@discussions.microsoft.com> posted
> :
> >
> >Is this a way to compare the start and finish times I output from the Time
> >function and then display the result in seconds for how long it took to copy.
>
> The answer that Stephen has given, while possibly helpful, does not
> answer your actual question. Assuming that by "this" you mean "there",
> the answer is "Yes"; and this is its proof :-
>
> Ans = (FinishTime - StartTime) * 86400
>
> Read <URL:http://www.merlyn.demon.co.uk/vb-dates.htm>.
>
> --
> © John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
> <URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
> <URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
> <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
>

Re: Comparing two time values for Difference by Brian

Brian
Fri Apr 08 06:19:05 CDT 2005

Sorry for the Bad English I did mean "There"

As I am learning scripting any help is greatly appreciated

Thank you

I also found

TimeDifference = DateDiff("s", StartTime, FinishTime)
IF TimeDifference < 12 THEN
' WScript.Echo TimeDifference


"Steven Burn" wrote:

> '// Time taken
> Dim lStart, x
> lStart = Timer()
> For x = 1 to 5000
> '// lalalalala
> Next
> WScript.Echo CDBL(FormatNumber(Timer() - lStart, 3)) & " seconds"
>
> --
> Regards
>
> Steven Burn
> Ur I.T. Mate Group
> www.it-mate.co.uk
>
> Keeping it FREE!
>
> "Brian" <Brian@discussions.microsoft.com> wrote in message news:D097FD27-71E8-48B3-AACA-E52C288EC323@microsoft.com...
> > Hi
> >
> > Trying to create a basic simple script to copy a file and see how long it
> > takes to copy the file.
> >
> > Is this a way to compare the start and finish times I output from the Time
> > function and then display the result in seconds for how long it took to copy.
> >
> > Code shown below
> >
> >
> > Thanks
> >
> >
> > Set objFSO = CreateObject("Scripting.FileSystemObject")
> > 'WScript.StdOut.WriteLine ("Start Time: " & Time)
> > StartTime = Time
> > objFSO.CopyFile "S:\_TEMP_\clienttest\test", "C:\PC_MIG\Test\",
> > OverwriteExisting
> > FinishTime = Time
> > CopyOutput = "File Copy Test" &vbCRLf &vbCRLf
> > CopyOutput = CopyOutput & "[This Test should take no longer 10 Seconds]"
> > &vbCRLf &vbCRLf
> > CopyOutput = CopyOutput & "Test Started : " & StartTime &vbCRLf
> > CopyOutput = CopyOutput & "Test Finished : " & FinishTime &vbCRLf
> > WScript.Echo CopyOutput
>
>