aboutsummaryrefslogtreecommitdiff
path: root/ui/curses/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui/curses/ui.c')
-rw-r--r--ui/curses/ui.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ui/curses/ui.c b/ui/curses/ui.c
index 8a2d85a..4d633df 100644
--- a/ui/curses/ui.c
+++ b/ui/curses/ui.c
@@ -78,6 +78,7 @@ uint64_t g_vsiz_rng;
uint64_t g_ivpt_scroll;
char *g_line_buff;
uint64_t g_step_block;
+float g_steps_per_sec;
const wchar_t *g_zoomed_symbols = (
L"⠀⠁⠂⠃⠄⠅⠆⠇⡀⡁⡂⡃⡄⡅⡆⡇⠈⠉⠊⠋⠌⠍⠎⠏⡈⡉⡊⡋⡌⡍⡎⡏⠐⠑⠒⠓⠔⠕⠖⠗⡐⡑⡒⡓⡔⡕⡖⡗⠘⠙⠚⠛⠜⠝⠞⠟⡘⡙⡚⡛⡜⡝⡞⡟"
@@ -386,6 +387,11 @@ void ui_ulx_field(int l, const char *label, uint64_t value) {
ui_line(false, l, PAIR_NORMAL, A_NORMAL, "%-4s : %#18lx", label, value);
}
+void ui_float_field(int l, const char *label, float value) {
+ assert(label);
+ ui_line(false, l, PAIR_NORMAL, A_NORMAL, "%-4s : %18.1f", label, value);
+}
+
// ----------------------------------------------------------------------------
// Core page functions
// ----------------------------------------------------------------------------
@@ -912,6 +918,7 @@ void ui_print() {
ui_ulx_field(l++, "step", g_steps);
ui_ulx_field(l++, "sync", g_syncs);
ui_ulx_field(l++, "step", g_step_block);
+ ui_float_field(l++, "stps", g_steps_per_sec);
switch (g_page) {
case PAGE_CORE:
@@ -1266,6 +1273,7 @@ void ev_handle() {
break;
case ' ':
g_running = !g_running;
+ g_steps_per_sec = 0.f;
nodelay(stdscr, g_running);
break;
case '1':
@@ -1347,6 +1355,9 @@ void exec() {
if ((end - beg) >= (CLOCKS_PER_SEC / MAX_FPS) && g_step_block != 1) {
g_step_block >>= 1;
}
+
+ float secs = (float)(end - beg) / (float)CLOCKS_PER_SEC;
+ g_steps_per_sec = (float)g_step_block / secs;
}
ui_print();