Add clock functionality with simple message loop

Signed-off-by: darkenk <darkenk@gmail.com>