X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/9701b7ab4dc4cd709ad4dcaa750fc0021f15e231..be1b46cc784e43cd28c5521bdcde79bd7463fb40:/include/stg/utime.h?ds=sidebyside 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; + } };