clock_t start = clock(); ifstream fin(objpath,std::ios::binary); vector<char> buf(fin.seekg(0,std::ios::end).tellg()); fin.seekg(0,std::ios::beg).read(&buf[0],static_cast<std::streamsize>(buf.size())); fin.close(); clock_t end = clock(); cout << "time:" << ((double)end-start)/CLOCKS_PER_SEC << "s\n";
clock_t start = clock(); ifstream fin(objpath); stringstream buf; buf << fin.rdbuf(); fin.close(); clock_t end = clock(); cout << "time:" << ((double)end-start)/CLOCKS_PER_SEC << "s\n";