first commit

This commit is contained in:
2026-06-22 11:49:35 +02:00
commit d805f2ba86
619 changed files with 126873 additions and 0 deletions

View File

@ -0,0 +1,51 @@
/* -----------------------------------------------------------------------------
GSFramework
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
----------------------------------------------------------------------------- */
#ifndef __NBENCHMARK__
#define __NBENCHMARK__
#include "time/ntime.h"
#include "container/smart_median_average.h"
namespace GS {
/*!
@short Benchmark.
@author Emmanuel Julien (ejulien@owloh.com)
*/
class Benchmark
{
SmartMedianAverage <float> avg;
Time r_clock, t_clock;
public:
void Start();
void Stop();
float GetMs() const;
void Reset();
Benchmark(bool start = false);
};
/// Scoped benchmark.
struct ScopedBenchmark
{
Benchmark &bench;
ScopedBenchmark(Benchmark &b) : bench(b)
{ bench.Start(); }
~ScopedBenchmark()
{ bench.Stop(); }
};
} // GS
#endif // __NBENCHMARK__