On Jul 14, 2010, at 8:28 AM, Tee Dubb <teedubb / gmail.com> wrote:
> I am making a constant network connection that is feeding me
> information, i want to take that information and place into nested /
> two-dimensional array for 1 minute, below is the code that's not
> working.

[snip]

> So after I sleep for 1 minute you would think the @junk two dimensional
> array has filled up but it hasn't, what's the best way to solve this
> problem?

Well, *I* wouldn't think that would be the case... Sleep suspends the execution of your program until the timer expires, so nothing else is happening during that time.

There are lots of ways that you could do what you want... Perhaps the "simplest" way would be to capture the time in a variable before you start, and check it after every row. If a minute has gone by, stop. However, that won't be terribly accurate and you won't guarantee exactly one minute.

Another option would be to start another thread to manage the timing, but I'm not sure right off the top of my head what that would look like.

A third option might be to use the Timeout class, but that is sort of a hack. You should read up on these options and pick one that works for you.

ri Thread
ri Timeout