diff --git a/internal/staging/primitives/pow_bench_test.go b/internal/staging/primitives/pow_bench_test.go index 6cf98ae8..1587da83 100644 --- a/internal/staging/primitives/pow_bench_test.go +++ b/internal/staging/primitives/pow_bench_test.go @@ -30,3 +30,13 @@ func BenchmarkUint256ToDiffBits(b *testing.B) { Uint256ToDiffBits(n) } } + +// BenchmarkCalcWork benchmarks calculating a work value from difficulty bits. +func BenchmarkCalcWork(b *testing.B) { + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + const input = 0x1b01330e + CalcWork(input) + } +}