Measure render loop
This commit is contained in:
parent
950e04ddb7
commit
f5e9ba0279
|
@ -1,9 +1,11 @@
|
|||
#include "FontWriter/font_writer.hpp"
|
||||
#include "Objects/paco.hpp"
|
||||
#include "Overlay/Overlay.hpp"
|
||||
#include "assets.hpp"
|
||||
#include <PSX/GPU/gpu.hpp>
|
||||
#include <PSX/GPU/gpu_primitives.hpp>
|
||||
#include <PSX/Timer/frame_timer.hpp>
|
||||
#include <PSX/Timer/high_res_timer.hpp>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace JabyEngine;
|
||||
|
@ -33,10 +35,28 @@ static void render() {
|
|||
}
|
||||
|
||||
void main() {
|
||||
static constexpr size_t MaxRounds = 1;
|
||||
|
||||
size_t avg = 0;
|
||||
size_t cur_rounds = 0;
|
||||
setup();
|
||||
|
||||
Overlay::mesaure_busy_loop();
|
||||
JabyEngine::HighResTime::enable();
|
||||
|
||||
while(true) {
|
||||
const auto start = JabyEngine::HighResTime::get_time_stamp();
|
||||
update();
|
||||
render();
|
||||
const auto end = JabyEngine::HighResTime::get_time_stamp();
|
||||
|
||||
avg += start.microseconds_to(end);
|
||||
cur_rounds++;
|
||||
if(cur_rounds == GPU::Display::frames_per_sec) {
|
||||
printf("AVG Time: %ius\n", avg/MaxRounds);
|
||||
|
||||
avg = 0;
|
||||
cur_rounds = 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,4 +9,3 @@ _ZN10JabyEngine7SysCall6printfEPKcz:
|
|||
li $t2, 0xa0
|
||||
jr $t2
|
||||
li $t1, 0x3f
|
||||
|
Loading…
Reference in New Issue