|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How do I measure the time it takes to copy a file?I want to copy a file from one PC to another using DotNet and would like to
time the operation- how do I do it? Julian,
>I want to copy a file from one PC to another using DotNet and would like to On a 1Gb connection or over a 22Kb dataline?>time the operation- how do I do it? Cor do something like this:
Dim dtMark As DateTime = Now ' do your file copy here Dim sec As Double = Now.Subtract(dtMark).TotalSeconds ' at this point, sec is double precision seconds that the copy took Show quoteHide quote "Julian Milano" wrote: > I want to copy a file from one PC to another using DotNet and would like to > time the operation- how do I do it? > > > "Julian Milano" <jdm***@datafast.net.au> schrieb im Newsbeitrag Well, you would have to implement a copy mechanism that calls anews:e2X3yL1PFHA.1392@TK2MSFTNGP10.phx.gbl... > I want to copy a file from one PC to another using DotNet and would like to > time the operation- how do I do it? callbackfunction after every nth part of your file has been copied, so you could gradually improve the estimate of your completion time (a simple estimating function would be completion time = start time + (elapsed time / n) * 100) Something like this:
Dim dtStart As DateTime = DateTime.Now 'copy file here Dim tsElapsed As TimeSpan = DateTime.Now.Subtract(dtStart) MsgBox("Elapsed time: " & tsElapsed.TotalSeconds.ToString) "Julian Milano" <jdm***@datafast.net.au> schrieb: StopWatch>I want to copy a file from one PC to another using DotNet and would like to >time the operation- how do I do it? <URL:http://www.mentalis.org/soft/class.qpx?id=8> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> |
|||||||||||||||||||||||