Integrate time measurement
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <PSX/GPU/gpu.hpp>
|
||||
#include <PSX/GPU/make_gpu_primitives.hpp>
|
||||
#include <PSX/Periphery/periphery.hpp>
|
||||
#include <PSX/Timer/high_res_timer.hpp>
|
||||
|
||||
namespace GPUTest {
|
||||
using namespace JabyEngine;
|
||||
@@ -120,7 +121,10 @@ namespace GPUTest {
|
||||
void main() {
|
||||
rect9.concat(rect10);
|
||||
Shared::back_menu.reset();
|
||||
HighResTime::enable();
|
||||
|
||||
auto start_time = HighResTime::get_time_stamp();
|
||||
auto time_passed = 0;
|
||||
while(true) {
|
||||
// Update Phase
|
||||
Periphery::query_controller();
|
||||
@@ -128,7 +132,13 @@ namespace GPUTest {
|
||||
break;
|
||||
}
|
||||
|
||||
auto cursor = FontWriter::update(Make::PositionI16((GPU::Display::Width - 160)/2, GPU::Display::Height - 32));
|
||||
FontWriter::bios_font_writer.write(cursor, "Time: %ims", GPU::Color24::Blue(), time_passed);
|
||||
|
||||
GPU::swap_buffers_vsync(1);
|
||||
const auto end_time = HighResTime::get_time_stamp();
|
||||
time_passed = start_time.milliseconds_to(end_time);
|
||||
start_time = end_time;
|
||||
|
||||
GPU::render(triangle1);
|
||||
GPU::render(triangle2);
|
||||
@@ -159,5 +169,6 @@ namespace GPUTest {
|
||||
GPU::render(rect9);
|
||||
Shared::back_menu.render();
|
||||
}
|
||||
HighResTime::disable();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user