]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/perf/howExpensiveIs/sieve.h
ICU-491.11.1.tar.gz
[apple/icu.git] / icuSources / test / perf / howExpensiveIs / sieve.h
diff --git a/icuSources/test/perf/howExpensiveIs/sieve.h b/icuSources/test/perf/howExpensiveIs/sieve.h
new file mode 100644 (file)
index 0000000..7ac86d2
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ **********************************************************************
+ * Copyright (c) 2011,International Business Machines
+ * Corporation and others.  All Rights Reserved.
+ **********************************************************************
+ */
+
+#ifndef SIEVE_H
+#define SIEVE_H
+
+#define U_LOTS_OF_TIMES 1000000
+
+#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
+ * @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