Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
1.0 KiB

//+---------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1996.
//
// File: B E N C H M R K . H
//
// Contents: Benchmark class.
//
// Notes:
//
// Author: billbe 13 Oct 1997
//
//---------------------------------------------------------------------------
#pragma once
const CHAR c_sznEmpty[] = {'\0'};
class CBenchmark
{
public:
CBenchmark();
~CBenchmark();
void Start(PCSTR sznDescription);
void Stop();
double DblBenchmarkSeconds()
{
return m_i64TotalTime / static_cast<double>(m_i64Frequency);
}
PCSTR SznDescription(){return m_sznDescription ? m_sznDescription : c_sznEmpty;}
PCSTR SznBenchmarkSeconds(unsigned short usPrecision);
private:
__int64 m_i64Frequency;
PSTR m_sznDescription;
__int64 m_i64StartTime;
__int64 m_i64TotalTime;
BOOL m_fStarted;
BOOL m_fSupported;
CHAR m_sznSeconds[50];
};