public static void timeout(long timeInMillis) {
		long start = System.currentTimeMillis();
		long end = start + timeInMillis;
		long now;
		long prev = 0;

		while ((now = System.currentTimeMillis()) < end) {

			// print every second
			if (((now - start) % 1000 == 0) && (now != prev)) {
				System.out.print(".");
				prev = now;
			}

			// timeout
		}

		System.out.println();
	}