mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 04:07:10 +01:00 
			
		
		
		
	Only start Section's timer if the duration will be used
This is a small potential runtime optimization on systems with virtual syscalls, and a significant runtime optimization on systems without.
This commit is contained in:
		| @@ -16,7 +16,11 @@ namespace Catch { | ||||
|     :   m_info( info ), | ||||
|         m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) ) | ||||
|     { | ||||
|         m_timer.start(); | ||||
|         // Non-"included" sections will not use the timing information | ||||
|         // anyway, so don't bother with the potential syscall. | ||||
|         if (m_sectionIncluded) { | ||||
|             m_timer.start(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     Section::~Section() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský