X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/9701b7ab4dc4cd709ad4dcaa750fc0021f15e231..1a42b634841392c7c0516bcb76fcc33f6d700808:/include/stg/utime.h 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; + } };