GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — cppbor/bench.cpp at master · RantyDave/cppbor Expand file tree/ Copy pathbench.cppMore file actions 34 lines (29 loc) · 998 Bytes / Copy pathbench.cppFile metadata and controls34 lines (29 loc) · 998 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 34 #include <iostream> #include <chrono> #include <unistd.h> #include "cppbor/cppbor.hpp" using namespace std; using namespace std::chrono; int main() { // open file, find it's size FILE* f=fopen("../cbor-python-wrote", "r"); fseek(f , 0 , SEEK_END); size_t size=static_cast<size_t>(ftell(f)); rewind(f); // create and load into buffer vector<uint8_t> cbor_data_in(size); fread(cbor_data_in.data(), size, 1, f); fclose(f); // decode cbor sleep(1); high_resolution_clock::time_point start=high_resolution_clock::now(); cbor_variant cbor_original=cbor_variant::construct_from(cbor_data_in); high_resolution_clock::time_point end=high_resolution_clock::now(); sleep(1); // report duration<float> time_taken=duration_cast<duration<float>>(end-start); cout << "Places: " << get<cbor_map>(cbor_original).size() << endl; cout << "Parse time: " << time_taken.count() << endl; // cout << cbor_original.as_python() << endl; } |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |