Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ time nanoseconds

#include <iostream>
#include <chrono>

int main() {
    auto start = std::chrono::high_resolution_clock::now();
    // operation to be timed ...
    auto finish = std::chrono::high_resolution_clock::now();
    auto time_in_nanoseconds =  std::chrono::duration_cast<std::chrono::nanoseconds>(finish-start).count();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #time #nanoseconds
ADD COMMENT
Topic
Name
3+1 =