cwTime.h/cpp : Added elapsedSecs().
This commit is contained in:
parent
53dfdbc2a5
commit
1259ba96fb
13
cwTime.cpp
13
cwTime.cpp
@ -78,6 +78,19 @@ unsigned cw::time::elapsedMs( const spec_t& t0 )
|
|||||||
return elapsedMs(t0,t1);
|
return elapsedMs(t0,t1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double cw::time::elapsedSecs( const spec_t& t0, const spec_t& t1 )
|
||||||
|
{
|
||||||
|
return elapsedMicros(t0,t1) / 1000000.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
double cw::time::elapsedSecs( const spec_t& t0 )
|
||||||
|
{
|
||||||
|
spec_t t1;
|
||||||
|
get(t1);
|
||||||
|
return elapsedSecs(t0,t1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned cw::time::absElapsedMicros( const spec_t& t0, const spec_t& t1 )
|
unsigned cw::time::absElapsedMicros( const spec_t& t0, const spec_t& t1 )
|
||||||
{
|
{
|
||||||
if( isLTE(t0,t1) )
|
if( isLTE(t0,t1) )
|
||||||
|
6
cwTime.h
6
cwTime.h
@ -29,7 +29,11 @@ namespace cw
|
|||||||
// Wrapper on elapsedMicros()
|
// Wrapper on elapsedMicros()
|
||||||
unsigned elapsedMs( const spec_t& t0, const spec_t& t1 );
|
unsigned elapsedMs( const spec_t& t0, const spec_t& t1 );
|
||||||
unsigned elapsedMs( const spec_t& t0 );
|
unsigned elapsedMs( const spec_t& t0 );
|
||||||
|
|
||||||
|
// Wrapper on elapsedMicros()
|
||||||
|
double elapsedSecs( const spec_t& t0, const spec_t& t1 );
|
||||||
|
double elapsedSecs( const spec_t& t0 );
|
||||||
|
|
||||||
// Same as elapsedMicros() but the times are not assumed to be ordered.
|
// 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.
|
// The function therefore begins by swapping t1 and t0 if t0 is after t1.
|
||||||
unsigned absElapsedMicros( const spec_t& t0, const spec_t& t1 );
|
unsigned absElapsedMicros( const spec_t& t0, const spec_t& t1 );
|
||||||
|
Loading…
Reference in New Issue
Block a user