Results 1 to 7 of 7

Thread: Low Level GetTickCount?

Hybrid View

  1. #1

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032

    Low Level GetTickCount?

    Code:
    Private Declare Function NtGetTickCount Lib "ntdll.dll" () As Long
    seems to work fine for me under Windows 2000. Anyone know how to tell for sure if the Win32 GetTickCount API is a wrapper around this native API? Because if its a lower level, it might be somewhat more efficient for debug time testing. Then again, the 10ms resolution of accuracy might cancel out a difference.

    Thanks.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  2. #2
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    VB Code:
    1. Imports System
    2. Imports System.Environment
    3. Public Module modmain
    4.    Sub Main()
    5.       'The KPD-Team 2001
    6.       'URL: [url]http://www.allapi.net/dotnet/[/url]
    7.       'E-Mail: [email][email protected][/email]
    8.       Console.WriteLine("The number of minutes that " + _
    9.         "have elapsed since the system was started " + _
    10.         "is " + (TickCount/1000/60).ToString)
    11.    End Sub
    12. End Module
    Please rate my post.

  3. #3

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Originally posted by Shawn N
    VB Code:
    1. Imports System
    2. Imports System.Environment
    3. Public Module modmain
    4.    Sub Main()
    5.       'The KPD-Team 2001
    6.       'URL: [url]http://www.allapi.net/dotnet/[/url]
    7.       'E-Mail: [email][email protected][/email]
    8.       Console.WriteLine("The number of minutes that " + _
    9.         "have elapsed since the system was started " + _
    10.         "is " + (TickCount/1000/60).ToString)
    11.    End Sub
    12. End Module
    ??? What does that have to do with my question?
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  4. #4
    Megatron
    Guest
    The most efficient high-resolution timer is QueryPerformanceCounter. I believe it's accurate down to the nanosecond.

    And it's supported in both WinNT and Win9x.

  5. #5
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Shawn, its that VB.NET?

    i come across that the nanosecond, but it also depend on the hardware right? Meg

  6. #6
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    I don't know what I was thinking. Yea, that's VB.Net
    Please rate my post.

  7. #7
    Megatron
    Guest
    Originally posted by Chris
    Shawn, its that VB.NET?

    i come across that the nanosecond, but it also depend on the hardware right? Meg
    Yes.

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