Merge pull request #203 from AussieBacom/master

added get elapsed time from clock in seconds
This commit is contained in:
erwincoumans 2014-07-31 18:05:24 -07:00
commit c471e27280
2 changed files with 13 additions and 0 deletions

View File

@ -237,6 +237,14 @@ unsigned long int btClock::getTimeMicroseconds()
/// Returns the time in s since the last call to reset or since
/// the Clock was created.
btScalar btClock::getTimeSeconds()
{
static const btScalar microseconds_to_seconds = btScalar(0.000001);
return btScalar(getTimeMicroseconds()) * microseconds_to_seconds;
}
inline void Profile_Get_Ticks(unsigned long int * ticks)

View File

@ -52,6 +52,11 @@ public:
/// Returns the time in us since the last call to reset or since
/// the Clock was created.
unsigned long int getTimeMicroseconds();
/// Returns the time in s since the last call to reset or since
/// the Clock was created.
btScalar getTimeSeconds();
private:
struct btClockData* m_data;
};