Re: time() not returning Integer
- Posted by Derek Parnell <ddparnell at big?ond.com> Jun 30, 2007
- 512 views
Tristen Wilson wrote: It might help if you actually took the time to understand the help that you are being given. If after trying to work through that, you are still not getting it, then ask a NEW and DIFFERENT question that refines your issue rather than a pleading "help me!". It idea is to get people to sympathize with your plight and your not quite achieving that yet. I'll say it again ... time() returns an atom and not an integer. So therefore the variable you assign the result to must be an atom and not an integer. You code should be more like ...
include get.e include misc.e atom start, stop -- NOT INTEGER procedure loop() start = time() -- Time to start some long loop puts(2, "At loop:") -- OUTSIDE THE LOOP for i = 0 to 100000 do ? i end for clear_screen() -- OUTSIDE THE LOOP stop = time() - start printf(2, "Total time Elapsed: %f", stop) -- NOT %d sleep(2) end procedure loop()
By the way, this took 20.68 seconds on my machine. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell