implement code style of clock.c