X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Ftiming%2Ftimestamp.cxx;h=83eff2fc10ea485c8039634132b958f1ac866cef;hb=b47d1ad5fd8ed111cae99c1f65f5bb65a5371501;hp=7f7773f490174a7d1587e7ba990b450524428772;hpb=7e7ce2f38e87d6244e05730fa4382da088bb25f1;p=simgear.git diff --git a/simgear/timing/timestamp.cxx b/simgear/timing/timestamp.cxx index 7f7773f4..83eff2fc 100644 --- a/simgear/timing/timestamp.cxx +++ b/simgear/timing/timestamp.cxx @@ -59,7 +59,7 @@ #include "timestamp.hxx" void SGTimeStamp::stamp() { -#if defined( WIN32 ) && !defined(__CYGWIN__) +#ifdef _WIN32 unsigned int t; t = timeGetTime(); _sec = t / 1000; @@ -104,3 +104,10 @@ void SGTimeStamp::stamp() { #endif } +int SGTimeStamp::elapsedMSec() const +{ + SGTimeStamp now; + now.stamp(); + + return static_cast((now - *this).toMSecs()); +}