implemented a simple timer.