X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/9701b7ab4dc4cd709ad4dcaa750fc0021f15e231..c517056585ce9699f0d8b3be6423ef953e90c47b:/include/stg/utime.h?ds=inline diff --git a/include/stg/utime.h b/include/stg/utime.h index 20da4e43..853b3db1 100644 --- a/include/stg/utime.h +++ b/include/stg/utime.h @@ -46,7 +46,7 @@ struct UTIME: public timeval tv_usec = 0; } - UTIME(time_t t) + explicit UTIME(time_t t) { tv_sec = t; tv_usec = 0; @@ -164,6 +164,11 @@ struct UTIME: public timeval { return tv_usec; } + + double AsDouble() const + { + return tv_sec + tv_usec * 1e-6; + } };