how to implement a method to count time in a game????