计时 Timing
chrono
class Timing
{
private:
typedef chrono::time_point<std::chrono::high_resolution_clock> TP;
TP current_time()
{ return chrono::high_resolution_clock::now(); }
TP st,ed;
public:
void start() { st=current_time(); }
void end() { ed=current_time(); }
void print()
{
cout<<chrono::duration_cast<chrono::microseconds>(ed-st).count()
<<"ms\n";
}
}timing;
Next: [模板][数据结构] 树状数组 Binary Index Tree/Fenwick Tree