This page is READ-ONLY. It is generated from the old site.
All timestamps are relative to 2013 (when this page is generated).
If you are looking for TeX support, please go to VietTUG.org

STDOUT: what's wrong with these lines?

it's a bit tricky, isn't it?
Added by ruby about 1 year ago  »  Votes: 2/2

The purpose of this portion of code is to print a star every one second

1 while true do
2   STDOUT.write("*")
3   sleep(1)
4 done

Do you think that it really works? and why?


Comments

Added by ruby 11 months ago

It doesn't work. You need to flush the buffer by STDOUT.flush before going to sleep