decide when to excute the javascript code by cpu rate