Home All Groups Group Topic Archive Search About

¿How can I to get the time of execution of an application?

Author
27 May 2006 9:31 PM
Carlos Villaseñor M.
Hi everybody!

I need to make a benchmark executing a DLL's functions series in a "for"
cicle, but I need to get the initial y final time and then get the
difference to make a benchmark. I Tried with "Time of date, Now()", but I
can't to convert that results in an integer...¿How can I do that?

I appreciate some help

Regards
Carlos Villaseñor M.

Author
27 May 2006 9:39 PM
tommaso.gastaldi
hi Carlos, there are several ways to do it. Here is the most primitive:

        Dim StartTime As Date = Now
        'processing here ...
        MsgBox("ElapsedTime: " &
Now.Subtract(StartTime).TotalMilliseconds & " millisecs")

-tom

Carlos Villaseñor M. ha scritto:

Show quoteHide quote
> Hi everybody!
>
> I need to make a benchmark executing a DLL's functions series in a "for"
> cicle, but I need to get the initial y final time and then get the
> difference to make a benchmark. I Tried with "Time of date, Now()", but I
> can't to convert that results in an integer...¿How can I do that?
>
> I appreciate some help
>
> Regards
> Carlos Villaseñor M.
Author
28 May 2006 4:52 AM
Cor Ligthert [MVP]
Carlos,

Measuring time on a multipurpose computer is never sure. Therefore you have
to do things more times.

I use for this

dim start as integer = environment.tickscount ' to get a time in
milliseconds
I hope this helps,

Cor

Show quoteHide quote
"Carlos Villaseñor M." <cvmdis***@avantel.net> schreef in bericht
news:O74MlSdgGHA.356@TK2MSFTNGP02.phx.gbl...
> Hi everybody!
>
> I need to make a benchmark executing a DLL's functions series in a "for"
> cicle, but I need to get the initial y final time and then get the
> difference to make a benchmark. I Tried with "Time of date, Now()", but I
> can't to convert that results in an integer...¿How can I do that?
>
> I appreciate some help
>
> Regards
> Carlos Villaseñor M.
>
>
>