Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <boost/date_time/posix_time/posix_time_types.hpp>
- #include "crc.hpp"
- void some(boost::crc_32_type& result, void* ptr, size_t size);
- int main()
- {
- std::vector<char> v(32 * 1024 * 1024, 42);
- boost::crc_32_type result;
- const int LOOP_CNT = 10;
- boost::posix_time::ptime t1 = boost::posix_time::microsec_clock::universal_time();
- for (int i=0; i<LOOP_CNT; i++)
- some(result, &v[0], v.size());
- boost::posix_time::ptime t2 = boost::posix_time::microsec_clock::universal_time();
- std::cout << std::hex << result.checksum() << std::endl;
- std::cout << "Time: " << (t2 - t1).total_milliseconds() / float(LOOP_CNT) << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement