From: Alex Zunega Date: 2009-09-03T14:57:02+09:00 Subject: Re: Threads - running something in background 7stud -- wrote: > Alex Zunega wrote: >> >> I just want something to time these iteration (one per second, for >> example), and everytime that I insert some "sleep" method, the Updater >> would "sum 1" to @i only when I try to access @i attribute. >> >> What I expect, in other words, is to have an @i very close to the number >> of seconds of the object life, just to prove that it works... > > You aren't making any sense. On the one hand, you say that you want @i > to tell you the number of seconds the object has been "alive". On the > other hand, you say you only want to add 1 to @i when you try to access > @i. Which is it? Actually, you're right, I was not clear, but I meant the second one. After initialized, 10 seconds later, when retrieving @i value I would like to see @i as 10, meaning that for 10 times it updated itself. -- Posted via http://www.ruby-forum.com/.