function getDisplayTime() { return caca_get_display_time($this->dp); }
function demo_go($dp, $demo, $cv, $bounds, $outline) { caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); caca_clear_canvas($cv); while (!caca_get_event($dp, CACA_EVENT_KEY_PRESS)) { if (function_exists($demo)) { $demo($cv, $bounds, $outline); } caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); caca_draw_thin_box($cv, 1, 1, caca_get_canvas_width($cv) - 2, caca_get_canvas_height($cv) - 2); $rate = sprintf("%01.2f", 1000000 / caca_get_display_time($dp)); caca_put_str($cv, 4, 1, "[{$rate} fps]----"); caca_refresh_display($dp); } display_menu($cv, $dp, $bounds, $outline); caca_refresh_display($dp); }