Displaying Updates Over Time
- Posted by euphoric (admin) Oct 07, 2010
- 1058 views
I've got a Euphoria program that could potentially iterate over some code millions of times. At first I was running this in a console and using a position() and printf() to display updates, but I know that takes a little time and, over the course of millions of iterations, could have a drastic affect on the time it takes to run. Or maybe not. Maybe that's something I should test.
Anyway, so then I used a if integer(counter/10000) then... to display an update, but I'm wondering if the "if" statement and division over every iteration is just as slow as a position()+puts() combo. Probably not, but it still takes time.
Now I'm wondering if setting up a timer in a multitasking task that hits every second might work. I'll give that a try, but I'd like to get ideas from everybody else.
Oh, I've thought of maybe a
if get_key() = ' ' then -- display some info end if
which is still an "if" but might be faster than an integer type-check plus division.
So, what's the best way to keep up-to-date on a program's process over millions of iterations? :)