struct timespec tm;
clock_gettime( CLOCK_REALTIME, &tm);
cout << tm.tv_nsec;
Include <ctime> and link with -lrt option in linux. Most probably this code does not work on Windows.
struct timespec tm;
clock_gettime( CLOCK_REALTIME, &tm);
cout << tm.tv_nsec;
Include <ctime> and link with -lrt option in linux. Most probably this code does not work on Windows.
[…] in nanoseconds which is used as a seed. For an implementation of currentTimeNS() function see this link. Advertisement GA_googleAddAttr("AdOpt", "0"); GA_googleAddAttr("Origin", "other"); […]
By: random_shuffle with Boost generator « Lokah Samastha Sughino Bhavantu on August 27, 2011
at 4:56 am