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

📄 timer.h

📁 signal-processing.rar信号处理demo原码
💻 H
字号:
/*
//
//               INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//    Copyright (c) 2006 Intel Corporation. All Rights Reserved.
//
*/

#ifndef __TIMER_H__
#define __TIMER_H__

#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#ifdef linux
#include <time.h>
#endif
#include "ippdefs.h"

#define USEC (double)1000000.0
#define MSEC (double)1000.0

class CTimer
{
public:
  enum units
  {
    sec, msec, usec
  };

  CTimer(void);
  virtual ~CTimer(void);

  void Init(void);
  void Start(void);
  void Stop(void);

  void RaisePriority();
  void LowerPriority();

  Ipp64u GetCpuClocks(void);
  double GetTime(CTimer::units u = usec);

private:
  Ipp64u m_c0;
  Ipp64u m_c1;
#ifdef _WIN32
  LARGE_INTEGER m_freq;
  LARGE_INTEGER m_t0;
  LARGE_INTEGER m_t1;
#endif
#ifdef linux
  clock_t m_t0;
  clock_t m_t1;
#endif
};

#endif

⌨️ 快捷键说明

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