<?

// не доделан

class Ui_timeout {
	private static $tasks = array();

	static function add($name, $sec, $func, $obj='', $arg='') {
		$this->tasks[$name] = array(
			'timeout'=>microtime(true) + $sec,
			'func'=>$func,
			'obj'=>$obj,
			'arg'=>$arg,
		);
	}

	// обработка всех заданий
	static function processed() {
		foreach($this->tasks as $name=>$task) {
			if($task['timeout'] < microtime(true))
				continue;

			call_user_func(array($obj, $method_name), $parameter /* , ... */);
		}
	}
}

?>