summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu/icu-src/source/test/perf/howExpensiveIs/sieve.h
blob: 80e6709884458a903f9cc479517d2fa33ecfafbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 ***********************************************************************
 * Copyright (C) 2016 and later: Unicode, Inc. and others.
 * License & terms of use: http://www.unicode.org/copyright.html#License
 ***********************************************************************
 ***********************************************************************
 * Copyright (c) 2011-2012,International Business Machines
 * Corporation and others.  All Rights Reserved.
 ***********************************************************************
 */

#ifndef SIEVE_H
#define SIEVE_H

#ifndef U_LOTS_OF_TIMES
#define U_LOTS_OF_TIMES 1000000
#endif

#include "unicode/utypes.h"
/**
 * Calculate the standardized sieve time (1 run)
 */
U_INTERNAL double uprv_calcSieveTime(void);

/**
 * Calculate the mean time, with margin of error
 * @param times array of times (modified/sorted)
 * @param timeCount length of array - on return, how many remain after throwing out outliers
 * @param marginOfError out parameter: gives +/- margin of err at 95% confidence
 * @return the mean time, or negative if error/imprecision.
 */
U_INTERNAL double uprv_getMeanTime(double *times, uint32_t *timeCount, double *marginOfError);

/**
 * Get the standardized sieve time. (Doesn't recalculate if already computed.
 * @param marginOfError out parameter: gives +/- margin of error at 95% confidence.
 * @return the mean time, or negative if error/imprecision.
 */
U_INTERNAL double uprv_getSieveTime(double *marginOfError);

#endif