Hacker News
points by ahartmetz 2 days ago | 0 comments
Yeah, that is a pitfall one shouldn't fall into even the first time programming something like that - it's pretty obvious, I think? You need to start the deadline timer if it's not running, then keep it running - don't restart it when more input arrives.

Also, this:

> Where DEADLINE is something appropriate for human perception, like 100ms or so

is way off. You easily notice a hitch of one frame in 60 fps content, and this is comparable. The timer should be something like 1-10 ms. Outputting multiple lines is really fast, so even 1 ms would merge most output into a single write() call. I'd start with 1 ms and raise it if there's a strong reason, which there probably isn't.

Aún no hay comentarios.
Hacker News