Skip to content

Instantly share code, notes, and snippets.

@Izaron

Izaron/test.cpp

Created Aug 22, 2018
Embed
What would you like to do?
Measure the running time with `time ./test` on Linux
#include <iostream>
#include <boost/dynamic_bitset.hpp>
int maxn = 1e8;
int bits = 100;
void test1() {
boost::dynamic_bitset<> bs(bits, abs(rand()));
int a = 0;
for (int i = 0; i < maxn; i++) {
a += bs.count();
}
std::cout << a << std::endl;
}
int main() {
std::cout << boost::dynamic_bitset<>::bits_per_block << std::endl;
srand(time(NULL));
test1();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.