Code example for ScheduledExecutorService

Methods: schedule, scheduleAtFixedRate

0
			System.out.println("Getting Readings");
			onResume(); 
			} 
		}; 
		 
		final ScheduledFuture beeperHandle = scheduler.scheduleAtFixedRate(beeper, 0, 10, SECONDS);
		//final ScheduledFuture beeperHandle = scheduler.schedule(beeper, 0, SECONDS); 
		scheduler.schedule(new Runnable() 
		{ 
			public void run() 
			 { 
			beeperHandle.cancel(true);
			System.out.println("Readings over");
			//scheduler.shutdown(); 
			//sm.unregisterListener(listen, accsensor); 
			//GetAccReadings(myFile, 5, 10, 10); 
			} 
		} 
		, 60 , SECONDS);
		 
	}