c++ get nanoseconds from timestamp code example
Example: 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();
}