porffor 0.0.0-8c0bdaa → 0.0.0-a2afb57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/tmp.c ADDED
@@ -0,0 +1,61 @@
1
+ #ifdef _WIN32
2
+ #include <windows.h>
3
+ #else
4
+ #include <time.h>
5
+ #endif
6
+
7
+ #include <stdio.h>
8
+
9
+ long long state0 = 1028798103;
10
+ long long state1 = 477374377;
11
+ double t = 0;
12
+
13
+ double inline __Math_random() {
14
+ long long s1 = 0;
15
+ long long s0 = 0;
16
+
17
+ s1 = state0;
18
+ state0 = (s0 = state1);
19
+ state1 = ((((s1 = (s1 ^ (s1 << 23)))) ^ s0) ^ (s1 >> 17)) ^ (s0 >> 26);
20
+ return ((double)((state1 + s0) & 2097151) / 2.097152e+6);
21
+ }
22
+
23
+ double randoms(double max) {
24
+ double sum = 0;
25
+ double i = 0;
26
+
27
+ sum = 0e+0;
28
+ i = 0e+0;
29
+ while (i < max) {
30
+ sum = sum + __Math_random();
31
+ i = i + 1e+0;
32
+ }
33
+ return sum;
34
+ }
35
+
36
+ double inline __performance_now() {
37
+ double _time_out;
38
+ #ifdef _WIN32
39
+ LARGE_INTEGER _time_freq, _time_t;
40
+ QueryPerformanceFrequency(&_time_freq);
41
+ QueryPerformanceCounter(&_time_t);
42
+ _time_out = ((double)_time_t.QuadPart / _time_freq.QuadPart) * 1000.;
43
+ #else
44
+ struct timespec _time;
45
+ clock_gettime(CLOCK_MONOTONIC, &_time);
46
+ _time_out = _time.tv_nsec / 1000000. + _time.tv_sec * 1000.;
47
+ #endif
48
+ return _time_out;
49
+ }
50
+
51
+ void inline __console_log(double x) {
52
+ printf("%f\n", x);
53
+ printf("%c", (int)(1e+1));
54
+ }
55
+
56
+ int main() {
57
+ t = __performance_now();
58
+ randoms(1e+5);
59
+ __console_log(__performance_now() - t);
60
+ }
61
+