File: strtoi-bench.c

package info (click to toggle)
dateutils 0.4.5-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,072 kB
  • sloc: ansic: 22,115; makefile: 1,686; yacc: 202; sh: 168; lex: 108
file content (21 lines) | stat: -rw-r--r-- 417 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include "strops.h"
#include "strops.c"
#include "nifty.h"

static const char *tst1[] = {"84", "52", "01", "99", "102", "120", "001", "4"};
static const char *tst0[] = {"8.4", "5a", "a1", "9.", "1+2", "", "\t", "#4"};

int
main(void)
{
	int32_t s = 0;

	for (size_t i = 0; i < 100000000U; i++) {
		const char *UNUSED(x);
		s += strtoi_lim(tst1[0U], &x, 0, 90);
	}
	printf("%d\n", s);
	return 0;
}