Skip to content
Snippets Groups Projects
Commit 9afb810f authored by Aaron's avatar Aaron
Browse files

Fixed Issue #60. Improved randomization granularity for shuffleBed.

Previously used time() which has 1 second precision.
Now use gettimeofday() which has millisecond precision.
parent 4c47efc2
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,11 @@ BedShuffle::BedShuffle(string &bedFile, string &genomeFile, string &excludeFile,
srand(seed);
}
else {
srand((unsigned)time(0));
timeval tim;
gettimeofday(&tim, NULL);
int t1=tim.tv_sec+tim.tv_usec;
srand((unsigned)t1);
}
_bed = new BedFile(bedFile);
......
......@@ -18,6 +18,7 @@
#include <map>
#include <cstdlib>
#include <ctime>
#include <sys/time.h>
using namespace std;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment