X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=p_s%2Frelative_time.go;fp=p_s%2Frelative_time.go;h=2cf742b2771c01b77f8c20c8c79f3c4cc277afc8;hb=c5eb0ee3c462a88cd96a8095063aae6117fce992;hp=2339d28bb4d2fad0187953927b0fa90d167d36e1;hpb=4d5f13104def6d48d9c32d701e9e0fd574e37a46;p=pstop.git diff --git a/p_s/relative_time.go b/p_s/relative_time.go index 2339d28..2cf742b 100644 --- a/p_s/relative_time.go +++ b/p_s/relative_time.go @@ -1,17 +1,21 @@ +// manage the time the statistics were taken package p_s import ( "time" ) +// object to hold the last collection time type InitialTime struct { initial_time time.Time } +// reflect we've just collected statistics func (t *InitialTime) SetNow() { t.initial_time = time.Now() } +// return the last time we collected statistics func (t InitialTime) Last() time.Time { return t.initial_time }