 {
 	import weavejs.WeaveAPI;
 	import weavejs.api.core.ICallbackCollection;
+	import weavejs.api.core.IDisposableObject;
 	import weavejs.api.core.ILinkableObject;
 	import weavejs.api.core.IScheduler;
 	import weavejs.util.DebugTimer;

	 * 
	 * @author adufilie
	 */
	public class Scheduler implements IScheduler
	{
		public function Scheduler()
		{
			_nextAnimationFrame = JS.requestAnimationFrame(handleCallLater);
			initVisibilityHandler();
		}
		
		public function dispose():void
		{
			JS.cancelAnimationFrame(_nextAnimationFrame);
		}
		
		public static var debug_fps:Boolean = false;
		public static var debug_async_time:Boolean = false;
		public static var debug_async_stack:Boolean = false;
		public static var debug_async_stack_elapsed:Boolean = false;
		public static var debug_delayTasks:Boolean = false; // set this to true to delay async tasks
		public static var debug_callLater:Boolean = false; // set this to true to delay async tasks
		public static var debug_visibility:Boolean = false; // set this to true to delay async tasks
		public var averageFrameTime:int = 0;
		private var _currentFrameStartTime:int = JS.now(); // this is the result of JS.now() on the last ENTER_FRAME event.
		private var _previousFrameElapsedTime:int = 0; // this is the amount of time it took to process the previous frame.

		/**
		 * This function gets called during ENTER_FRAME and RENDER events.
		 */
		private function _handleCallLater():void
		{
			// detect deactivated framerate (when app is hidden)
			if (deactivated)
			{
