+ Reply to Thread
Results 1 to 3 of 3

Hundreths

  1. #1
    Registered User
    Join Date
    10-16-2006
    Location
    Shreveport, LA
    Posts
    32

    Hundreths

    Trying to see the hundredths, waht am I missing?

    Sub TimerTest()

    Dim StartTime, EndTime, TotalTime, C
    StartTime = Now
    Do Until C = 10
    C = C + 1
    Loop
    EndTime = Now
    TotalTime = EndTime - StartTime
    MsgBox ("Total Time " & Format(TotalTime, "ss.00"))

    End Sub



    ww
    Last edited by Paul; 10-16-2008 at 01:14 PM.

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    I think, probably the function NOW does not deal in fractions of seconds. Use the following instead:

    Sub TimerTest()

    Dim StartTime, EndTime, TotalTime, C
    StartTime = Timer
    Do Until C > 1230
    C = C + 1
    Loop
    EndTime = Timer
    TotalTime = EndTime - StartTime
    MsgBox "Total Time " & Round(TotalTime, 2)

    End Sub
    Mangesh

  3. #3
    Registered User
    Join Date
    10-16-2006
    Location
    Shreveport, LA
    Posts
    32
    Thanks!

    Had to replace Round with Format. Got an error message with round in, but this works just like I wanted it too!

    Thanks again.

    ww




    Sub TimerTest()

    Dim StartTime, EndTime, TotalTime, C
    StartTime = Timer
    Do Until C > 1230
    C = C + 1
    Loop
    EndTime = Timer
    TotalTime = EndTime - StartTime
    MsgBox "Total Time " & Format(TotalTime, "#0.0#")

    End Sub
    Last edited by ww2u; 11-09-2006 at 10:41 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1