|
|
nono 0.1.2
//
// nono
// Copyright (C) 2020 nono project
// Licensed under nono-license.txt
//
#pragma once
#include "header.h"
#include <list>
#include <chrono>
using namespace std::chrono;
//
// パフォーマンス測定。
// 定期的に実行される区間の平均所要時間を測定する。
// (今の所レンダラ用)
//
class PerfCounter
{
public:
// xxx は1回の結果を表示するのにかかるループ回数
PerfCounter(int xxx);
~PerfCounter() { }
// 測定開始。
void Start() {
start = system_clock::now();
}
// 測定終了
void End() {
end = system_clock::now();
PrintResult();
}
private:
// 結果の集計と表示
void PrintResult();
system_clock::time_point start {};
system_clock::time_point end {};
int xxx {}; // XXX 名前なんだろ
int total_elapsed {};
int total_count {};
std::list<int> fpsarray {};
};
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.