require 'time'
targetTime = 3
diff = targetTime - 1; diff *= 60 #Time.now
diff = diff < 0 ? 0 : diff;
sT = diff % 60
mT = (diff - sT)/60
puts "%dm %02ds" % [mT, sT]
cmVxdWlyZSAndGltZScKdGFyZ2V0VGltZSA9IDMKCmRpZmYgPSB0YXJnZXRUaW1lIC0gMTsgZGlmZiAqPSA2MCAjVGltZS5ub3cKCQlkaWZmID0gZGlmZiA8IDAgPyAwIDogZGlmZjsKCQlzVCA9IGRpZmYgJSA2MAoJCW1UID0gKGRpZmYgLSBzVCkvNjAKcHV0cyAiJWRtICUwMmRzIiAlIFttVCwgc1Rd