Skip to content

Commit

Permalink
Start printing output rate only after first bytes are written
Browse files Browse the repository at this point in the history
  • Loading branch information
jnalanko committed Apr 13, 2023
1 parent 3de1225 commit 96fc342
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/pseudoalign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ void pseudoalignment::print_thread(atomic<int64_t>* total_length_of_sequence_pro
first_print = false;
std::this_thread::sleep_for(std::chrono::seconds(1));
seconds++;
std::cerr << "Input: "
<< *total_length_of_sequence_processed / 1e6 / seconds << " Mbase/s"
<< ", Output: "
<< ((double) *total_bytes_written) / (1 << 20) / seconds << " MB/s " << std::flush;

std::cerr << "Input: " << *total_length_of_sequence_processed / 1e6 / seconds << " Mbase/s";

if(*total_bytes_written > 0){
std::cerr << ", Output: " << ((double) *total_bytes_written) / (1 << 20) / seconds << " MB/s";
}

std::cerr << " " << std::flush;
// Added spaces to the end to erase trailing characters from the previous line
}
cerr << endl;
Expand Down

0 comments on commit 96fc342

Please sign in to comment.