Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

how to get the wall time of special code line?

sun__lei
Beginner
2,294 Views

how to get the wall time of special code line?

0 Kudos
2 Replies
ArthurRatz
Novice
2,294 Views

Here's an example:

std::clock_t start = std::clock();

// do some work

std::clock_t finish = std::clock();

std::double_t time_span = finish - start;

std::cout << "Execution time: " << time_span << "\n";

Good luck.

0 Kudos
Bernard
Valued Contributor I
2,242 Views

At least you may use a partially ordered RDTSCP instruction.

Be aware, that assembly implementation may run in the "shadow" of RDTSCP instruction (i.e. execute faster (in terms of pipeline stage of execution, than RDTSCP instruction)

0 Kudos
Reply