greenplumn ITimer 源码
greenplumn ITimer 代码
文件路径:/src/backend/gporca/libgpos/include/gpos/common/ITimer.h
//---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2011 EMC Corp.
//
// @filename:
// ITimer.h
//
// @doc:
// A timer which records time between construction and the ElapsedMS call;
//---------------------------------------------------------------------------
#ifndef GPOS_ITimer_H
#define GPOS_ITimer_H
#include "gpos/types.h"
#include "gpos/utils.h"
namespace gpos
{
//---------------------------------------------------------------------------
// @class:
// ITimer
//
// @doc:
// Timer interface;
//
//---------------------------------------------------------------------------
class ITimer
{
private:
public:
ITimer(const ITimer &) = delete;
// ctor
ITimer() = default;
// dtor
virtual ~ITimer() = default;
// retrieve elapsed time in micro-seconds
virtual ULONG ElapsedUS() const = 0;
// retrieve elapsed time in milli-seconds
ULONG
ElapsedMS() const
{
return ElapsedUS() / GPOS_USEC_IN_MSEC;
}
// restart timer
virtual void Restart() = 0;
}; // class ITimer
} // namespace gpos
#endif // !GPOS_ITimer_H
// EOF
相关信息
相关文章
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
7、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦