effective working screenRect

Geoff Canyon gcanyon at gmail.com
Sat Aug 10 18:26:13 EDT 2013


Okay, this is really weird. This barely moves the CPU needle -- 3% CPU
usage for me:

   repeat 50
      wait 10 ticks
   end repeat

This punches the CPU pretty hard -- 20% CPU usage for me, > 6x, despite it
only cycling twice as often:

   repeat 100
      wait 5 ticks
   end repeat

Then this scales pretty much the way I would expect, 50% (2.5x):

   repeat 200
      wait 2 ticks
   end repeat

And as you said, this pegs at 100%

   repeat 200
      wait 1 ticks
   end repeat


On Sat, Aug 10, 2013 at 4:01 PM, Mark Wieder <mwieder at ahsoftware.net> wrote:

> Geoff-
>
> Saturday, August 10, 2013, 1:28:11 PM, you wrote:
>
> > I suppose, but still I would expect that a loop like that would leave
> > 99.99% of whatever device it's running on free to do whatever, since that
> > code is executing a max of 60 times per second, and should take the
> > smallest fraction of a second to run each time.
>
> But wait without messages is blocking, so the tight loop is using up
> all of the available cpu time. Even though the wait is sitting there
> for 1/60 of a second, nothing else is getting done.
>
> --
> -Mark Wieder
>  mwieder at ahsoftware.net
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list