Tramway SDK
stats.h
Go to the documentation of this file.
1// Tramway Drifting and Dungeon Exploration Simulator SDK Runtime
2
3#ifndef TRAM_SDK_FRAMEWORK_STATS_H
4#define TRAM_SDK_FRAMEWORK_STATS_H
5
6#include <framework/system.h>
7
8#include <cstddef>
9
10namespace tram::Stats {
11
12enum Resource : uint32_t {
15};
16
17void Start(System::system_t system);
18void Stop(System::system_t system);
19
20void Add(Resource resource, size_t ammount);
21void Remove(Resource resource, size_t ammount);
22
23void Collate();
24
25size_t GetStat(Resource resource);
26double GetStat(System::system_t system);
27double GetStatAverage(System::system_t system);
29
30}
31
32#endif // TRAM_SDK_FRAMEWORK_STATS_H
Definition: resource.h:11
Resource usage statistics.
void Collate()
Collates all of the time statistics.
Definition: stats.cpp:95
void Stop(System::system_t system)
Stops counting time spent on a system.
Definition: stats.cpp:60
Resource
Definition: stats.h:12
@ RESOURCE_DRAWCALL
Definition: stats.h:14
@ RESOURCE_VRAM
Definition: stats.h:13
void Start(System::system_t system)
Starts counting time spent on a system.
Definition: stats.cpp:42
size_t GetStat(Resource resource)
Returns the uncollated ammount of a resource.
Definition: stats.cpp:127
void Add(Resource resource, size_t ammount)
Adds an ammount of a resource.
Definition: stats.cpp:75
void Remove(Resource resource, size_t ammount)
Removes an ammount of a resource.
Definition: stats.cpp:85
double GetStatAverage(System::system_t system)
Returns the ammount of resource, averaged over the last second.
Definition: stats.cpp:157
double GetStatUncollated(System::system_t system)
Returns the uncollated time of a system.
Definition: stats.cpp:147
uint32_t system_t
Definition: system.h:10