public void run() {

		// Adjust sleeping time to avoid too small times
		double sampleInterval = DESIRED_INTERVAL;
		double execInterval   = sampleInterval / mySpeed;

		if (execInterval < MINIMUM_INTERVAL) {
			execInterval = MINIMUM_INTERVAL;
			sampleInterval = MINIMUM_INTERVAL * mySpeed;
		}

		try {
			long t = 0;
			long start = System.currentTimeMillis();
			while(true) {
				// Update simulation state
				updateState(sampleInterval/1000.0);

				// Delay thread execution
				t += execInterval;
				long time = System.currentTimeMillis();
				long sleep = t - (time - start);
				RTThread.sleep(sleep>0?sleep:0);
			}
		}
		catch(Exception e) { /* Shouldn't happen */ }
	}