Skip to content

Commit

Permalink
Ensure benchmark "op" time is non-zero
Browse files Browse the repository at this point in the history
On my system, at least, I get random divide-by-zero
errors due to this coming out too small.
  • Loading branch information
josephwright committed Oct 26, 2018
1 parent f28d1f1 commit 40fe4dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions l3experimental/l3benchmark/l3benchmark.dtx
Expand Up @@ -425,6 +425,8 @@
{ \int_gset:Nn \g_@@_duration_int { 256 } } % arbitrary single operation
\@@_aux:
\fp_gset_eq:NN \g_@@_one_op_fp \g_benchmark_time_fp
\fp_compare:nNnT \g_@@_one_op_fp < { 1e-6 }
{ \fp_gset:Nn \g_@@_one_op_fp { 1e-6 } }
}
\cs_new_protected:Npn \benchmark_silent:n #1
{
Expand Down

0 comments on commit 40fe4dc

Please sign in to comment.