diff --git a/stim/envi/bsq.h b/stim/envi/bsq.h index ae3492f..0caeef7 100644 --- a/stim/envi/bsq.h +++ b/stim/envi/bsq.h @@ -377,6 +377,10 @@ public: } bool bil(std::string outname, bool PROGRESS = false){ + + size_t in_time, out_time, calc_time; //initialize the timing variables + in_time = out_time = calc_time = 0; + size_t XY = X() * Y(); //number of elements in an input slice size_t XB = X() * Z(); //number of elements in an output slice size_t XYbytes = XY * sizeof(T); //number of bytes in an input slice @@ -413,7 +417,7 @@ public: file.seekg(jump, std::ios::cur); //jump to the next band } auto in_end = std::chrono::high_resolution_clock::now(); - std::cout << std::chrono::duration_cast(in_end-in_begin).count() << "ms" << std::endl; + in_time += std::chrono::duration_cast(in_end-in_begin).count(); auto calc_begin = std::chrono::high_resolution_clock::now(); @@ -428,15 +432,19 @@ public: } } auto calc_end = std::chrono::high_resolution_clock::now(); - std::cout << std::chrono::duration_cast(calc_end-calc_begin).count() << "ms" << std::endl; + calc_time += std::chrono::duration_cast(calc_end-calc_begin).count(); auto out_begin = std::chrono::high_resolution_clock::now(); target.write((char*)ptrOut, batch_bytes); //write the batch to disk auto out_end = std::chrono::high_resolution_clock::now(); - std::cout << std::chrono::duration_cast(out_end-out_begin).count() << "ms" << std::endl; + out_time += std::chrono::duration_cast(out_end-out_begin).count(); if(PROGRESS) progress = (double)( c + 1 ) / (batches) * 100; } + std::cout<<"BSQ->BIL reads: "<<(double)in_time / (1000 * 60)<<" min"<BIL calculations: "<<(double)calc_time / (1000 * 60)<<" min"<BIL writes: "<<(double)out_time / (1000 * 60)<<" min"<