From a5a5398e240d39cedb7d944edb833d8449da3e11 Mon Sep 17 00:00:00 2001 From: fche Date: Fri, 2 Sep 2005 15:54:18 +0000 Subject: 2005-09-02 Frank Ch. Eigler * tapset/*.stp: Renamed several files to simplify names. --- tapset/timestamp.stp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tapset/timestamp.stp (limited to 'tapset/timestamp.stp') diff --git a/tapset/timestamp.stp b/tapset/timestamp.stp new file mode 100644 index 00000000..f8e1ea4e --- /dev/null +++ b/tapset/timestamp.stp @@ -0,0 +1,19 @@ +%{ +#include +%} + +// return in milliseconds since epoch +function gettimeofday_ms () %{ + struct timeval tm; + do_gettimeofday (& tm); + THIS->__retvalue = (tm.tv_sec * 1000) + (tm.tv_usec / 1000); +%} + +// return in seconds since epoch +function gettimeofday_s () %{ + struct timeval tm; + do_gettimeofday (& tm); + THIS->__retvalue = tm.tv_sec; +%} + +// likewise jiffies, monotonic_clock ... -- cgit