Opps, forgot this.
[core.git] / inc / classes / main / tasks / idle / class_IdleLoopTask.php
index 0dd2de9f3d169987f4747f6219f39a9048667826..20d394be53c76a3f0b4a9caf1314be9f21daa1cf 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 class IdleLoopTask extends BaseTask implements Taskable, Visitable {
+       /**
+        * Idle loop time
+        */
+       private $idleTime = 0;
+
        /**
         * Protected constructor
         *
@@ -30,6 +35,9 @@ class IdleLoopTask extends BaseTask implements Taskable, Visitable {
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
+
+               // Init idle loop time from config ("cache" it here)
+               $this->idleTime = $this->getConfigInstance()->getConfigEntry('idle_loop_time');
        }
 
        /**
@@ -62,8 +70,8 @@ class IdleLoopTask extends BaseTask implements Taskable, Visitable {
         * @return      void
         */
        public function executeTask () {
-               // Idle here a little (2 milliseconds)
-               $this->idle(2);
+               // Idle here a little
+               $this->idle($this->idleTime);
        }
 
        /**