Programming with Judy

Using Judy
Using JudyL
Chapter 3 37
(void) puts ("\nJudyL demonstration: random(3M) histogram");
// SET NUMBER OF RANDOMS TO GENERATE
if (argc != 2)
{
// SET TO DEFAULT_ITER
num_vals = DEFAULT_ITER;
(void) printf ("Usage: %s [numvals]\n", argv[0]);
(void) printf (" Since you did not specify a number of values, %d\n",
num_vals);
(void) puts (" will be used as the number of random numbers to insert");
(void) puts (" into the Judy array");
}
else
{
// OVERRIDE NUMBER OF RANDOMS TO GENERATE
num_vals = atol(argv[1]);
}
// TIME THE GENERATION OF ALL THE RANDOM NUMBERS. THIS TIME IS LATER
//
// This time is later subtracted from the insert loop time so that the
// time it takes to do the actual JudyLIns can be isolated from the
// total time.
(void) puts ("\ntiming random number generation");
STARTTm;
for (iter = num_vals; iter; iter--)
{