Skip to content

Commit

Permalink
Merge pull request #65 from xushiwei/q
Browse files Browse the repository at this point in the history
stdpkgprogress: np
  • Loading branch information
xushiwei authored Aug 8, 2024
2 parents 46440fb + 1996bf8 commit dd013fe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chore/stdpkgprogress/go_stdpkg_progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func main() {
panic(err)
}
var done, total float64
var ndone, ntotal int
ret := doc.(githubisstask.Result)
for _, task := range ret.Tasks {
desc := task.Desc // fmt* (Imported By: 4513111)
Expand All @@ -28,11 +29,14 @@ func main() {
if n, e := strconv.Atoi(ntext); e == nil {
w := math.Log2(float64(n) + 1)
total += w
ntotal += n
if task.Done {
done += w
ndone += n
}
}
}
}
fmt.Printf("Progress: %.2f%%\n", done/total*100)
np := float64(ndone) / float64(ntotal) * 100
fmt.Printf("Progress: %.2f%% (%.2f%%)\n", done/total*100, np)
}

0 comments on commit dd013fe

Please sign in to comment.