Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/template.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ char * new_string_from_integer(int num)
int main(int argc, char ** argv)
{
int num_keys = atoi(argv[1]);
int i, value = 0;
int i, value = 0, key;

if(argc <= 2)
return 1;
Expand Down Expand Up @@ -78,6 +78,16 @@ int main(int argc, char ** argv)
DELETE_STR_FROM_HASH(new_string_from_integer(i));
}

else if (!strcmp(argv[2], "gapinsert"))
{
for(i = 0; i < num_keys; i++)
{
key = (i << 10) | (i & 1023);
INSERT_INT_INTO_HASH(key, value);
value++;
}
}

double after = get_time();
printf("%f\n", after-before);
fflush(stdout);
Expand Down