diff --git a/cwTime.cpp b/cwTime.cpp index 3c0d13d..672a30e 100644 --- a/cwTime.cpp +++ b/cwTime.cpp @@ -61,6 +61,10 @@ unsigned cw::time::elapsedMicros( const spec_t* t0, const spec_t* t1 ) return u1 - u0; } +unsigned cw::time::elapsedMs( const spec_t* t0, const spec_t* t1 ) +{ return elapsedMicros(t0,t1)/1000; } + + unsigned cw::time::absElapsedMicros( const spec_t* t0, const spec_t* t1 ) { if( isLTE(t0,t1) ) diff --git a/cwTime.h b/cwTime.h index 5c95a46..34383f7 100644 --- a/cwTime.h +++ b/cwTime.h @@ -25,6 +25,8 @@ namespace cw // t1 is assumed to be at a later time than t0. unsigned elapsedMicros( const spec_t* t0, const spec_t* t1 ); + // Wrapper on elapsedMicros() + unsigned elapsedMs( const spec_t* t0, const spec_t* t1 ); // Same as elapsedMicros() but the times are not assumed to be ordered. // The function therefore begins by swapping t1 and t0 if t0 is after t1.