mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-20 17:52:46 +00:00
ensure count > 0
This commit is contained in:
parent
3b375b55c2
commit
9002555596
@ -594,12 +594,14 @@ void PostgreSQL::initializeNetworks()
|
|||||||
auto dur = std::chrono::duration_cast<std::chrono::microseconds>(end - start);;
|
auto dur = std::chrono::duration_cast<std::chrono::microseconds>(end - start);;
|
||||||
total += dur.count();
|
total += dur.count();
|
||||||
++count;
|
++count;
|
||||||
if (count % 10000 == 0) {
|
if (count > 0 && count % 10000 == 0) {
|
||||||
fprintf(stderr, "Averaging %llu us per network\n", (total/count));
|
fprintf(stderr, "Averaging %llu us per network\n", (total/count));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "Took %llu us per network to load\n", (total/count));
|
if (count > 0) {
|
||||||
|
fprintf(stderr, "Took %llu us per network to load\n", (total/count));
|
||||||
|
}
|
||||||
stream.complete();
|
stream.complete();
|
||||||
|
|
||||||
w.commit();
|
w.commit();
|
||||||
@ -748,11 +750,13 @@ void PostgreSQL::initializeMembers()
|
|||||||
auto dur = std::chrono::duration_cast<std::chrono::microseconds>(end - start);;
|
auto dur = std::chrono::duration_cast<std::chrono::microseconds>(end - start);;
|
||||||
total += dur.count();
|
total += dur.count();
|
||||||
++count;
|
++count;
|
||||||
if (count % 10000 == 0) {
|
if (count > 0 && count % 10000 == 0) {
|
||||||
fprintf(stderr, "Averaging %llu us per member\n", (total/count));
|
fprintf(stderr, "Averaging %llu us per member\n", (total/count));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf(stderr, "Took %llu us per member to load\n", (total/count));
|
if (count > 0) {
|
||||||
|
fprintf(stderr, "Took %llu us per member to load\n", (total/count));
|
||||||
|
}
|
||||||
|
|
||||||
stream.complete();
|
stream.complete();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user