Just use google. Type System.out.println() java, or you could also try Java IO. Also, an easy way to 'count' would be
// X
Thread.getThread().sleep(1000); //waits for 1 second.
//If you print out right here, you can be sure that the time is extremely close to 1 second from X