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

count() method from fcf::NTest::TimeDuration class

unsigned long long count() const

Class: fcf::NTest::TimeDuration

Package: fcfTest

File: test.hpp

Available from version: 1.2.5

Returns the raw duration value in nanoseconds.

The count method provides direct access to the underlying unsigned long long value representing the duration in nanoseconds.

Result
unsigned long long
- The duration in nanoseconds.

Example: Accessing raw nanoseconds

Demonstrating how to retrieve the raw nanosecond count.

#define FCF_TEST_IMPLEMENTATION #include <fcfTest/test.hpp> #include <iostream> FCF_TEST_DEFINE("TimeDemo", "Basics", "CountAccess") { fcf::NTest::TimeDuration duration(123456789ULL); // 1. Retrieve the raw count unsigned long long rawCount = duration.count(); // 2. Verify the value FCF_TEST(rawCount == 123456789ULL, rawCount); std::cout << "Raw count: " << rawCount << std::endl; } int main(int a_argc, char* a_argv[]) { bool error = false; fcf::NTest::cmdRun(a_argc, a_argv, fcf::NTest::CRM_RUN, &error); return error ? 1 : 0; }

Output:

Performing the test: "TimeDemo" -> "Basics" -> "CountAccess" ... Raw count: 123456789 [SUCCESS] Test completed successfully (0.000`000`000 sec) [SUCCESS] All tests were completed. Tests: 1 passed, 0 failed, 0 skipped, 1 total Duration: 0.000`000`000 sec