-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.cpp
43 lines (34 loc) · 887 Bytes
/
example.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <lit/common/time_utils.hpp>
#include <lit/common/logging.hpp>
#include <lit/common/assert.hpp>
#include <bit>
using namespace lit::common;
void ExampleTime() {
Timer timer;
double t = timer.ElapsedTime();
FpsMeter fps;
for(int i = 0; i < 9999; i++) {
fps.StartFrame();
// frame rendering
fps.EndFrame();
}
double average_fps = fps.GetAverageFps();
double average_ms = fps.GetAverageMsPerFrame();
}
void ExampleLogging() {
Logger::LogInfo("Some information %d", 5);
Logger::LogWarning("Warning!!! 2+2!=%d", 4);
Logger::LogError("Error!");
}
void ExampleAssert() {
LIT_ASSERT(2 + 2 == 4, "2 + 2 should be 4")
int x = 5, y = 7, z = x + y;
LIT_ENSURE(x + y == z)
LIT_ENSURE_EQ(x, 5)
LIT_ENSURE_BETWEEN(x, 4, 7)
}
int main() {
ExampleTime();
ExampleLogging();
ExampleAssert();
}