notcurses-demo FPS graph: back to straight seconds

pull/2274/head
nick black 3 years ago
parent 99169aea42
commit f05f65dc80
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -29,8 +29,6 @@ static int plot_grab_y = -1;
// position of the plot *when grab started*
static int plot_pos_y;
#define FPSHZ 2
#define FPSGRAPH_MAX_COLS 72 // give it some room on each side of an 80-column term
// how many columns for runtime?
@ -587,7 +585,7 @@ int demo_render(struct notcurses* nc){
if(!plot_hidden){
ncplane_move_family_top(ncuplot_plane(plot));
}
uint64_t ns = (timespec_to_ns(&ts) - plottimestart) / (NANOSECS_IN_SEC / FPSHZ);
uint64_t ns = (timespec_to_ns(&ts) - plottimestart) / NANOSECS_IN_SEC;
ncuplot_add_sample(plot, ns, 1);
}
if(menu){
@ -666,7 +664,7 @@ int fpsgraph_init(struct notcurses* nc){
NCPLOT_OPTION_PRINTSAMPLE;
opts.gridtype = NCBLIT_BRAILLE;
opts.legendstyle = NCSTYLE_ITALIC | NCSTYLE_BOLD;
opts.title = "frames per semisecond";
opts.title = "frames per second";
ncchannels_set_fg_rgb8(&opts.minchannels, 0x80, 0x80, 0xff);
ncchannels_set_bg_rgb(&opts.minchannels, 0x201020);
ncchannels_set_bg_alpha(&opts.minchannels, NCALPHA_BLEND);

Loading…
Cancel
Save