-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (30 loc) · 803 Bytes
/
main.cpp
File metadata and controls
33 lines (30 loc) · 803 Bytes
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
#include <iostream>
#include <unistd.h>
#include "pzmem.hpp"
PZ_MEM pz;
int main(int argc, char *argv[]) {
if (argc != 2) {
std::cout << "Usage: " << argv[0] << " <seed>\n";
return 1;
}
clock_t start, end;
start = clock();
pz.init(std::stoll(argv[1]));
end = clock();
std::cout << "Time: " << (double)(end - start) / CLOCKS_PER_SEC << std::endl;
unsigned char *tmpnonce = new unsigned char[42];
tmpnonce[40] = '\n';
tmpnonce[41] = 0;
start = clock();
for (int i = 0; i < 26843546; i++) {
pz.gen_nonce(i, tmpnonce);
}
end = clock();
std::cout << 26.843546 / ((double)(end - start) / CLOCKS_PER_SEC) << " MN/s\n";
std::cout << (double)CLOCKS_PER_SEC / (end - start) << " GB/s\n";
for (int i = 0; i < 4; i++) {
pz.gen_nonce(i, tmpnonce);
std::cout << tmpnonce;
}
return 0;
}