⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vmhighperfcounter.h

📁 TOOL (Tiny Object Oriented Language) is an easily-embedded, object-oriented, C++-like-language inter
💻 H
字号:
#ifndef HIGH_PERFORMANCE_COUNTERS_H_INCLUDED
#define HIGH_PERFORMANCE_COUNTERS_H_INCLUDED
/*****************************************************************************/
/*                              HEADER FILE                                  */
/*****************************************************************************/
/*
       $Archive:   $

      $Revision:   $
          $Date:   $
        $Author:   $

    Description:   Declaration of a high performance counter toolset

                      TOOL And XML FORMS License
                      ==========================

                      Except where otherwise noted, all of the documentation 
                      and software included in the TOOL package is 
                      copyrighted by Michael Swartzendruber.

                      Copyright (C) 2005 Michael John Swartzendruber. 
                      All rights reserved.

                      Access to this code, whether intentional or accidental,
                      does NOT IMPLY any transfer of rights.

                      This software is provided "as-is," without any express 
                      or implied warranty. In no event shall the author be held
                      liable for any damages arising from the use of this software.

                      Permission is granted to anyone to use this software for 
                      any purpose, including commercial applications, and to 
                      alter and redistribute it, provided that the following 
                      conditions are met:

                      1. All redistributions of source code files must retain 
                         all copyright notices that are currently in place, 
                         and this list of conditions without modification.

                      2. The origin of this software must not be misrepresented;
                         you must not claim that you wrote the original software.

                      3. If you use this software in another product, an acknowledgment
                         in the product documentation would be appreciated but is
                         not required.

                      4. Modified versions in source or binary form must be plainly 
                         marked as such, and must not be misrepresented as being 
                         the original software.
*/
/*****************************************************************************/

#include "../../../stdafx.h"


enum VMHPCTIME 
{
  VMHPC1USEC = 0,
  VMHPC2USEC,
  VMHPC3USEC,
  VMHPC4USEC,
  VMHPC5USEC,
  VMHPC6USEC,
  VMHPC7USEC,
  VMHPC8USEC,
  VMHPC9USEC,

  VMHPC10USEC,
  VMHPC20USEC,
  VMHPC30USEC,
  VMHPC40USEC,
  VMHPC50USEC,
  VMHPC60USEC,
  VMHPC70USEC,
  VMHPC80USEC,
  VMHPC90USEC,

  VMHPC100USEC,
  VMHPC200USEC,
  VMHPC300USEC,
  VMHPC400USEC,
  VMHPC500USEC,
  VMHPC600USEC,
  VMHPC700USEC,
  VMHPC800USEC,
  VMHPC900USEC,

  VMHPC1MSEC,
  VMHPC2MSEC,
  VMHPC3MSEC,
  VMHPC4MSEC,
  VMHPC5MSEC,
  VMHPC6MSEC,
  VMHPC7MSEC,
  VMHPC8MSEC,
  VMHPC9MSEC,

  VMHPC10MSEC,
  VMHPC15MSEC,
  VMHPC20MSEC,
  VMHPC25MSEC,
  VMHPC30MSEC,
  VMHPC35MSEC,
  VMHPC40MSEC,
  VMHPC45MSEC,
  VMHPC50MSEC,
  VMHPC55MSEC,
  VMHPC60MSEC,
  VMHPC65MSEC,
  VMHPC70MSEC,
  VMHPC75MSEC,
  VMHPC80MSEC,
  VMHPC85MSEC,
  VMHPC90MSEC,
  VMHPC95MSEC,

  VMHPC100MSEC,
  VMHPC150MSEC,
  VMHPC200MSEC,
  VMHPC250MSEC,
  VMHPC300MSEC,
  VMHPC350MSEC,
  VMHPC400MSEC,
  VMHPC450MSEC,
  VMHPC500MSEC,
  VMHPC550MSEC,
  VMHPC600MSEC,
  VMHPC650MSEC,
  VMHPC700MSEC,
  VMHPC750MSEC,
  VMHPC800MSEC,
  VMHPC850MSEC,
  VMHPC900MSEC,
  VMHPC950MSEC,

  VMHPC1SEC,
  VMHPC2SEC,
  VMHPC3SEC,
  VMHPC4SEC,
  VMHPC5SEC,
  VMHPC6SEC,
  VMHPC7SEC,
  VMHPC8SEC,
  VMHPC9SEC,

  VMHPC10SEC,

  VMHPCTIMECOUNT
};


// Initialize the high performance counter module.
//
void VMHighPerfCounterInit();

// Get the processor tick count.
//
LARGE_INTEGER VMGetHighPerfCounterTickCount( void );

// Get the number of processor ticks per second.
//
LARGE_INTEGER VMGetHighPerfCounterTicksPerSecond( void );

// Get a processor timeup timer for the given time (HPC time enumeration).
//
LARGE_INTEGER VMGetHighPerfCounterTimer( VMHPCTIME eHPCTime );


LARGE_INTEGER VMGetTickCountByOffset( VMHPCTIME eHPCTime );


// Return true if a processor timeup timer has elapsed.
//
BOOL VMIsHighPerfCounterTimerUp( LARGE_INTEGER xTimer );

// Convert a processor tick to milliseconds.
//
ULONG VMGetHighPerfCounterMillis( LARGE_INTEGER xTicks );

// Convert a processor tick to microseconds.
//
ULONG VMGetHighPerfCounterMicros( LARGE_INTEGER xTicks );

// Get the number of milliseconds that have elapsed since
// the given processor tick.
//
ULONG VMGetHighPerfCounterElapsedMillis( LARGE_INTEGER xTicks );


#endif


/*****************************************************************************/
/* Check-in history */
/*
 *$Log:  $
*/
/*****************************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -