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

📄 perftimer.cpp

📁 蚁群算法的C++实现,让读者更清晰的了解蚁群算法的完整思路
💻 CPP
字号:
// CPerfTimer - a simple Win32 performance counter wrapper
// by Dean Wyant dwyant@mindspring.com

#include "stdafx.h"
#include "PerfTimer.h"

// Declare and initialize static member vars that get set only once and never change
__int64 CPerfTimer::m_Freq = 0; 
__int64 CPerfTimer::m_Adjust = 0; 

// All functions defined inline for speed. After all, the performance counter is 
// supposed to be able to time very short events fairly accurately.



BOOL CPerfTimer::IsSupported()
{ // Returns FALSE if performance counter not supported.
  // Call after constructing at least one CPerfTimer
  return (m_Freq > 1);
}

const double CPerfTimer::Resolution()   
{ // Returns timer resolution in seconds
  return 1.0/(double)m_Freq; 
}

const double CPerfTimer::Resolutionms() 
{ // Returns timer resolution in milliseconds
  return 1000.0/(double)m_Freq; 
}

const double CPerfTimer::Resolutionus() 
{ // Returns timer resolution in microseconds
  return 1000000.0/(double)m_Freq; 
}



⌨️ 快捷键说明

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