X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=p_s%2Frelative_time.go;h=2cf742b2771c01b77f8c20c8c79f3c4cc277afc8;hb=f135d1827d906507807e5d5687a4806b63286df4;hp=2339d28bb4d2fad0187953927b0fa90d167d36e1;hpb=52d3c00ce729f908f342e10f48818b112dec0130;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 }