import { Canvas } from "https://deno.land/x/tui@1.3.4/src/canvas.ts";
Runs a loop in which it checks whether frameBuffer has changed (anything new has been drawn).
If so, run renderFrame()
with current frame buffer and in the way yield and emit proper events.
On each iteration it sleeps for adjusted refreshRate
time.