Simple question: How to find Elapsed time (in seconds)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bill Nguyen

    Simple question: How to find Elapsed time (in seconds)

    I need to display elapsed time for a process in VB.NET in secods.
    What's the routine to do this?
    Thanks

    Bill


  • tommaso.gastaldi@uniroma1.it

    #2
    Re: Simple question: How to find Elapsed time (in seconds)

    How about something simple like:

    Dim StartTime As DateTime = Now

    'Any processing here ...

    ElapsedTime = Now.Subtract(St artTime).TotalS econds
    Dim ElapsedTime As Double =
    Now.Subtract(St artTime).TotalS econds
    MsgBox("Elapsed seconds: " & ElapsedTime,
    MsgBoxStyle.Inf ormation)

    -tom

    Bill Nguyen ha scritto:
    [color=blue]
    > I need to display elapsed time for a process in VB.NET in secods.
    > What's the routine to do this?
    > Thanks
    >
    > Bill[/color]

    Comment

    • Bill Nguyen

      #3
      Re: Simple question: How to find Elapsed time (in seconds)


      Works great!
      Thanks Tomaso!

      Bill

      <tommaso.gastal di@uniroma1.it> wrote in message
      news:1141679714 .714292.14890@j 33g2000cwa.goog legroups.com...[color=blue]
      > How about something simple like:
      >
      > Dim StartTime As DateTime = Now
      >
      > 'Any processing here ...
      >
      > ElapsedTime = Now.Subtract(St artTime).TotalS econds
      > Dim ElapsedTime As Double =
      > Now.Subtract(St artTime).TotalS econds
      > MsgBox("Elapsed seconds: " & ElapsedTime,
      > MsgBoxStyle.Inf ormation)
      >
      > -tom
      >
      > Bill Nguyen ha scritto:
      >[color=green]
      >> I need to display elapsed time for a process in VB.NET in secods.
      >> What's the routine to do this?
      >> Thanks
      >>
      >> Bill[/color]
      >[/color]


      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Simple question: How to find Elapsed time (in seconds)

        Bill,

        As addition you can as well use the environment.tic kcount
        or
        The new stopwatch class 2.0
        Provides a set of methods and properties that you can use to accurately measure elapsed time.


        I hope this helps,

        Cor


        "Bill Nguyen" <billn_nospam_p lease@jaco.com> schreef in bericht
        news:OYPdHIVQGH A.5116@TK2MSFTN GP10.phx.gbl...[color=blue]
        >I need to display elapsed time for a process in VB.NET in secods.
        > What's the routine to do this?
        > Thanks
        >
        > Bill
        >[/color]


        Comment

        Working...