Shock! Even with the waiting time for cycling!

  Yesterday analyze performance issues, see paragraphs similar to the code along the following lines:

long beginTime = System.current();
long interval = 36;

for (int i=0; i<100; i++)
{
    if (System.current()-beginTime<interval)
    {
        i--;
        continue;
    }

    ......
}

  To wait for tens of milliseconds, so the CPU hard work ah. It is so creative.

  Quickly into sleep ()

Guess you like

Origin blog.csdn.net/quantum7/article/details/93708314