From 853bbb3752a5fa2f58ef456ffb6e3a552e13cb11 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 3 Aug 2025 19:22:36 +0200 Subject: initial commit --- simclist-1.5/perftest/ext.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 simclist-1.5/perftest/ext.c (limited to 'simclist-1.5/perftest/ext.c') diff --git a/simclist-1.5/perftest/ext.c b/simclist-1.5/perftest/ext.c new file mode 100644 index 0000000..8288b84 --- /dev/null +++ b/simclist-1.5/perftest/ext.c @@ -0,0 +1,31 @@ + +#include +#include +#include +#include + +#define NELS 1000000 + +size_t szelem(const void *el) { + return sizeof(int); +} + +int main() { + list_t l; + int i; + + srandom(time(NULL)); + + list_init(&l); + list_attributes_copy(&l, szelem, 1); + + for (i = 0; i < NELS; i++) { + list_append(&l, &i); + } + + for (i = 0; i < 1000; i++) { + list_get_at(&l, random()%NELS); + } + + return 0; +} -- cgit v1.2.3-70-g09d2