13 #include <vrecko/Export>
30 static Timer* instance();
33 osg::Timer_t tick()
const;
41 inline double time_s()
const {
return delta_s(_startTick, tick()); }
44 inline double time_m()
const {
return delta_m(_startTick, tick()); }
47 inline double time_u()
const {
return delta_u(_startTick, tick()); }
50 inline double time_n()
const {
return delta_n(_startTick, tick()); }
53 inline double delta_s( osg::Timer_t t1, osg::Timer_t t2 )
const {
return (
double)(t2 - t1)*_secsPerTick; }
56 inline double delta_m( osg::Timer_t t1, osg::Timer_t t2 )
const {
return delta_s(t1,t2)*1e3; }
59 inline double delta_u( osg::Timer_t t1, osg::Timer_t t2 )
const {
return delta_s(t1,t2)*1e6; }
62 inline double delta_n( osg::Timer_t t1, osg::Timer_t t2 )
const {
return delta_s(t1,t2)*1e9; }