CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 1999
    Posts
    1

    Milliseconds display

    Could someone enlighten me please.
    I am trying to write a routine which will make a note of how long a query takes to run. My problem is that I cannot find any reference to reading the current time including milliseconds.
    e.g. 3:34:18.245

    All the date/time functions only seem to go down to seconds. I have played around with the timer function but I can't believe there isn't a better way.

    Thanks.



  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Milliseconds display

    the GetSystemTime API fills a SYSTEMTIME structure that has a Milliseconds field.


  3. #3
    Join Date
    Sep 1999
    Posts
    18

    Re: Milliseconds display

    Try API function : GetTickCount


  4. #4
    Join Date
    Apr 1999
    Location
    Netherlands
    Posts
    181

    Re: Milliseconds display

    You can also use the Timer function, eg.
    Dim start as double
    start = Timer
    ' do what you want
    Msgbox Timer - start

    Crazy D @ Work :-)

  5. #5
    Join Date
    May 1999
    Posts
    3,332

    Re: Milliseconds display

    AFAIK Timer does not return Milliseconds. Am I wrong?


  6. #6
    Join Date
    Apr 1999
    Location
    Netherlands
    Posts
    181

    Re: Milliseconds display

    Oopsie guess it's too early to think...
    In reply to:


    Timer Function

    Returns a Single representing the number of seconds elapsed since midnight.

    Syntax

    Timer

    Remarks

    In Microsoft Windows the Timer function returns fractional portions of a second.




    I understood it was to see how long a query takes to execute, I always use Timer for that... but I you're right...

    Crazy D @ Work :-)

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured