Ruby Ruby Blocks Working With Blocks Build a Simple Benchmarker

Dots printing all at once at the end instead of printing at intervals with every loop ending

***Using Ruby 1.8.7

Here's the link to the code:

https://github.com/black789/Treehouse/blob/master/benchmarker.rb

2 Answers

Jay McGavren
STAFF
Jay McGavren
Treehouse Teacher

Your code works exactly as it is for me, printing the dots as it goes. I ran it under Ruby 2.3.0.

Ruby 1.8.7 is a very old version. That may be part of the problem. It might be a good idea to update it.

I can't update because the firm I work with uses this particular version. Isn't there a workaround for this kind of problem?

Jay McGavren
STAFF
Jay McGavren
Treehouse Teacher

sindhu shree I can't try this myself, because as I said your code works as-is for me. But you might find a partial solution here: https://stackoverflow.com/questions/29998728/what-stdout-sync-true-means

The solution from this link worked for me. Thanks