performance update: instant output, similar to stdout
timeout check is now efficient and doesn't affect the duration of your program to much