#!/usr/bin/env ruby # -*- coding: utf-8 -*- x = Time.now.year def next1sec(sec) while sec == Time.now.sec sleep 0.03 end Time.now.sec end while x == Time.now.year now = Time.now sec = now.sec just = now + 60 jh = just.hour jm = just.min while Time.now.min != jm sec = next1sec(sec) printf("%s\r",Time.now) if sec%10 == 0 print("") else end end end