我需要在x秒后运行一个函数,并具有一定的控制能力(重置计时器、停止计时器、查找剩余执行时间)。time.Timer非常适合-唯一缺少的是它似乎无法提供查找剩余时间的方法。我有哪些选择?此刻,我在想这样的事情:packagemainimport"time"typeSecondsTimerstruct{Ttime.DurationCchantime.Timecontrolchantime.Durationrunningbool}func(s*SecondsTimer)run(){fors.T.Seconds()>0{time.Sleep(time.Second)select{casef:=