FCF 2.0 development in progress...
> > > > > >
[News] [C++ Libraries API] [C++ Downloads] [Donate to the project] [Contacts]

end() method from fcf::NTest::Duration class

void end()

Class: fcf::NTest::Duration

Package: fcfTest

File: test.hpp

Available from version: 1.0.1

Records the current timestamp using a high-resolution clock to mark the end of a timing interval.

The end() method captures the current time point from std::chrono::high_resolution_clock. This method is used to finalize the measurement interval when performing manual timing of code blocks.

Example: Manual Timing Control

Use begin() and end() to wrap a specific section of code for precise measurement.

fcf::NTest::Duration bench; // Start measurement bench.begin(); // Code to be measured for(int i = 0; i < 1000000; ++i) { // Workload } // Stop measurement bench.end(); fcf::NTest::log() << "Total time: " << bench.totalDuration().count() << " ns" << std::endl;