Skip to content

Commit

Permalink
Allow printing arbitrary progress
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Jan 10, 2025
1 parent db8ad2d commit 416fc72
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/commons/Debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,13 @@ class Debug
prevPrintedId = 0;
}

void updateProgress(){
size_t id = __sync_fetch_and_add(&currentPos, 1);
void updateProgress(size_t pos = SIZE_MAX){
size_t id;
if (pos == SIZE_MAX) {
id = __sync_fetch_and_add(&currentPos, 1);
} else {
id = pos;
}
// if no active terminal exists write dots
if(interactive == false){
if(totalEntries==SIZE_MAX) {
Expand Down

0 comments on commit 416fc72

Please sign in to comment.