| | 1827 | #else |
|---|
| | 1828 | |
|---|
| | 1829 | // timing test code paths |
|---|
| | 1830 | |
|---|
| | 1831 | iv.setUseKdTreeWhenAvailable(true); |
|---|
| | 1832 | iv.setDoDummyTraversal(true); |
|---|
| | 1833 | |
|---|
| | 1834 | const_cast<osg::Camera*>(camera)->accept(iv); |
|---|
| | 1835 | |
|---|
| | 1836 | osg::Timer_t before = osg::Timer::instance()->tick(); |
|---|
| | 1837 | const_cast<osg::Camera*>(camera)->accept(iv); |
|---|
| | 1838 | |
|---|
| | 1839 | osg::Timer_t after_dummy = osg::Timer::instance()->tick(); |
|---|
| | 1840 | |
|---|
| | 1841 | iv.setDoDummyTraversal(false); |
|---|
| | 1842 | const_cast<osg::Camera*>(camera)->accept(iv); |
|---|
| | 1843 | osg::Timer_t after_kdTree_2 = osg::Timer::instance()->tick(); |
|---|
| | 1844 | |
|---|
| | 1845 | iv.setUseKdTreeWhenAvailable(false); |
|---|
| | 1846 | const_cast<osg::Camera*>(camera)->accept(iv); |
|---|
| | 1847 | osg::Timer_t after = osg::Timer::instance()->tick(); |
|---|
| | 1848 | |
|---|
| | 1849 | double timeDummy = osg::Timer::instance()->delta_m(before, after_dummy); |
|---|
| | 1850 | double timeKdTree = osg::Timer::instance()->delta_m(after_dummy, after_kdTree_2); |
|---|
| | 1851 | double timeConventional = osg::Timer::instance()->delta_m(after_kdTree_2, after); |
|---|
| | 1852 | |
|---|
| | 1853 | osg::notify(osg::NOTICE)<<"Using Dummy "<<timeDummy<<std::endl; |
|---|
| | 1854 | osg::notify(osg::NOTICE)<<" KdTrees "<<timeKdTree<<std::endl; |
|---|
| | 1855 | osg::notify(osg::NOTICE)<<" KdTrees - Traversal "<<timeKdTree-timeDummy<<std::endl; |
|---|
| | 1856 | osg::notify(osg::NOTICE)<<" Conventional "<<timeConventional<<std::endl; |
|---|
| | 1857 | osg::notify(osg::NOTICE)<<" Conventional - Traversal "<<timeConventional-timeDummy<<std::endl; |
|---|
| | 1858 | osg::notify(osg::NOTICE)<<" Delta "<<timeConventional/timeKdTree<<std::endl; |
|---|
| | 1859 | osg::notify(osg::NOTICE)<<" Delta sans Traversal "<<(timeConventional-timeDummy)/(timeKdTree-timeDummy)<<std::endl; |
|---|
| | 1860 | osg::notify(osg::NOTICE)<<std::endl; |
|---|
| | 1861 | #endif |
|---|