Populous: The Beginning Script 3  1.0.0
Documentation for Populous Script 3 engine
script3_profiler.h
Go to the documentation of this file.
1 #pragma once
2 #include "Game.h"
3 #include "Pop3Debug.h"
4 
6 {
7 public:
8  script3_profiler(const std::string & name) : _start(0)
9  {
10  _name = name;
11  }
13 
14  void start()
15  {
16  _start = GetTickCount64();
17  }
18 
19  const unsigned long long time_taken()
20  {
21  return GetTickCount64() - _start;
22  }
23 
24  void log(const std::string & file, unsigned int line)
25  {
26  Pop3Debug::trace("%s(%d) (%s): Time elapsed %d ms", file.c_str(), line, _name.c_str(), time_taken());
27  this->start();
28  }
29 private:
30  unsigned long long _start;
31  std::string _name;
32 };
void log(const std::string &file, unsigned int line)
script3_profiler(const std::string &name)
const unsigned long long time_taken()
unsigned long long _start