You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<spanid="_CPPv3N6ankerl9nanobench5Bench7contextEPKcPKc"></span><spanid="_CPPv2N6ankerl9nanobench5Bench7contextEPKcPKc"></span><spanid="ankerl::nanobench::Bench::context__cCP.cCP"></span><spanclass="target" id="classankerl_1_1nanobench_1_1Bench_1a40c5016aca69c0c5208d43eca5862804"></span><aclass="reference internal" href="#_CPPv4N6ankerl9nanobench5BenchE" title="ankerl::nanobench::Bench"><spanclass="n"><spanclass="pre">Bench</span></span></a><spanclass="w"></span><spanclass="p"><spanclass="pre">&</span></span><spanclass="sig-name descname"><spanclass="n"><spanclass="pre">context</span></span></span><spanclass="sig-paren">(</span><spanclass="kt"><spanclass="pre">char</span></span><spanclass="w"></span><spanclass="k"><spanclass="pre">const</span></span><spanclass="w"></span><spanclass="p"><spanclass="pre">*</span></span><spanclass="n sig-param"><spanclass="pre">variableName</span></span>, <spanclass="kt"><spanclass="pre">char</span></span><spanclass="w"></span><spanclass="k"><spanclass="pre">const</span></span><spanclass="w"></span><spanclass="p"><spanclass="pre">*</span></span><spanclass="n sig-param"><spanclass="pre">variableValue</span></span><spanclass="sig-paren">)</span><aclass="headerlink" href="#_CPPv4N6ankerl9nanobench5Bench7contextEPKcPKc" title="Permalink to this definition"></a><br/></dt>
260
+
<dd><p>Set context information. </p>
261
+
<p>The information can be accessed using custom render templates via <codeclass="docutils literal notranslate"><spanclass="pre">{{context(variableName)}}</span></code>. Trying to render a variable that hasn’t been set before raises an exception. Not included in (default) markdown table.</p>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">{{epochIterations}}</span></code> See <aclass="reference internal" href="#classankerl_1_1nanobench_1_1Bench_1afb83c3694a8f494c19d3114162fc9ebb"><spanclass="std std-ref">Bench::epochIterations()</span></a>.</p></li>
734
766
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">{{warmup}}</span></code> Number of iterations used before measuring starts. See <aclass="reference internal" href="#classankerl_1_1nanobench_1_1Bench_1a09d1947386503bddf1d34fe7d0338e98"><spanclass="std std-ref">Bench::warmup()</span></a>.</p></li>
735
767
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">{{relative}}</span></code> True or false, depending on the setting you have used. See <aclass="reference internal" href="#classankerl_1_1nanobench_1_1Bench_1afccbfce7dfbf7506410392f5ad096597"><spanclass="std std-ref">Bench::relative()</span></a>.</p></li>
768
+
<li><p>`{{context(variableName)}} See <aclass="reference internal" href="#classankerl_1_1nanobench_1_1Bench_1a40c5016aca69c0c5208d43eca5862804"><spanclass="std std-ref">Bench::context()</span></a>.</p></li>
736
769
</ul>
737
770
</p>
738
771
<p>Apart from these tags, it is also possible to use some mathematical operations on the measurement data. The operations are of the form <codeclass="docutils literal notranslate"><spanclass="pre">{{command(name)}}</span></code>. Currently <codeclass="docutils literal notranslate"><spanclass="pre">name</span></code> can be one of <codeclass="docutils literal notranslate"><spanclass="pre">elapsed</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">iterations</span></code>. If performance counters are available (currently only on current Linux systems), you also have <codeclass="docutils literal notranslate"><spanclass="pre">pagefaults</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">cpucycles</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">contextswitches</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">instructions</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">branchinstructions</span></code>, and <codeclass="docutils literal notranslate"><spanclass="pre">branchmisses</span></code>. All the measures (except <codeclass="docutils literal notranslate"><spanclass="pre">iterations</span></code>) are provided for a single iteration (so <codeclass="docutils literal notranslate"><spanclass="pre">elapsed</span></code> is the time a single iteration took). The following tags are available:<ul>
0 commit comments