src/rand.cpp

filter: Statementstmt 100% 6 / 6 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 6 / 6 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/lib/Devel/StatProfiler/Slowops.pm ↑ Summary src/snappy/csnappy_internal.h »
1 #include "rand.h"
2  
3 #include <cstddef>
4 #include <sys/time.h>
5  
6 using namespace devel::statprofiler;
7  
8 unsigned int
9 248 devel::statprofiler::rand_seed()
10 {
11 timeval now;
12  
13 248 gettimeofday(&now, NULL);
14  
15 248 return now.tv_sec * 1000 + now.tv_usec / 1000;
16 }
17  
18 void
19 50199034 devel::statprofiler::rand(unsigned int *seed)
20 {
21 // ANSI C linear congruential PRNG
22 50199034 *seed = (*seed * 1103515245 + 12345) & 0x7fffffffu;
23 50199034 }
« blib/lib/Devel/StatProfiler/Slowops.pm ↑ Summary src/snappy/csnappy_internal.h »