Welcome, guest | Sign In | My Account | Store | Cart

This is a counter which increments by 1 every second

JavaScript, 22 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
/******************************************************************/
/***	This is a counter which increments by 1 every second	***/
/******************************************************************/

public class Timer{

	public static void main(String[] args){
	
		int count = 0;
		for(;;){
			try {
				Thread.sleep(1000);
				count ++;
				System.out.println(count);
			}
			catch (InterruptedException e) {
				
				e.printStackTrace();
			}
		}
	}
}
Created by Agop Seropayn on Fri, 13 Nov 2009 (MIT)
JavaScript recipes (69)
Agop Seropayn's recipes (1)

Required Modules

  • (none specified)

Other Information and Tasks