timing ​
Implementation level ​
| Type | Status |
|---|---|
| CML extraction template | |
| HTML5 representation |
Template attributes ​
| Attribute | Value |
|---|---|
| source | xTB log |
| id | timing |
| name | Timings |
| pattern | \s*\-+\s*$\s*\*\s*finished\s*run\s*on.* |
| endPattern | \s* |
| endPattern2 | ~ |
| endOffset | 1 |
| xml:base | timings.xml |
Input
------------------------------------------------------------------------
* finished run on 2025/03/31 at 18:25:24.884
------------------------------------------------------------------------
total:
* wall-time: 0 d, 0 h, 0 min, 0.030 sec
* cpu-time: 0 d, 0 h, 0 min, 0.055 sec
* ratio c/w: 1.865 speedup
SCF:
* wall-time: 0 d, 0 h, 0 min, 0.013 sec
* cpu-time: 0 d, 0 h, 0 min, 0.030 sec
* ratio c/w: 2.385 speedup
Output text
xml
<comment class="example.output" id="timing">
<module cmlx:templateRef="timing" dictRef="cc:userDefinedModule">
<scalar dataType="xsd:date" dictRef="cc:dateEnd">2025-02-28T12:51:13.691</scalar>
<scalar dictRef="cc:walltime" units="si:s">0.075</scalar>
<scalar dictRef="cc:cputime" units="si:s">0.239</scalar>
</module>
</comment>Template definition
xml
<record />
<record>\s*\*\s*finished\s*run\s*on\s*{X,cc:dateEnd}</record>
<record repeat="2" />
<record id="walltime">\s*\*\s*wall-time:{F,x:day}\s*d\s*,{F,x:hour}\s*h\s*,{F,x:min}\s*min\s*,{F,x:second}\s*sec</record>
<record id="cputime">\s*\*\s*cpu-time:{F,x:day}\s*d\s*,{F,x:hour}\s*h\s*,{F,x:min}\s*min\s*,{F,x:second}\s*sec</record>
<transform process="pullup" xpath=".//cml:scalar" />
<transform process="addChild" xpath="." elementName="cml:scalar" dictRef="cc:walltime" />
<transform process="setValue" xpath=".//cml:scalar[@dictRef='cc:walltime']" value="$number( (//cml:list[@cmlx:templateRef='walltime']//cml:scalar[@dictRef='x:day']/text() * 86400) + (//cml:list[@cmlx:templateRef='walltime']//cml:scalar[@dictRef='x:hour']/text() * 360) + (//cml:list[@cmlx:templateRef='walltime']//cml:scalar[@dictRef='x:min']/text() * 60) + (//cml:list[@cmlx:templateRef='walltime']//cml:scalar[@dictRef='x:second']/text()))" />
<transform process="addChild" xpath="." elementName="cml:scalar" dictRef="cc:cputime" />
<transform process="setValue" xpath=".//cml:scalar[@dictRef='cc:cputime']" value="$number( (//cml:list[@cmlx:templateRef='cputime']//cml:scalar[@dictRef='x:day']/text() * 86400) + (//cml:list[@cmlx:templateRef='cputime']//cml:scalar[@dictRef='x:hour']/text() * 360) + (//cml:list[@cmlx:templateRef='cputime']//cml:scalar[@dictRef='x:min']/text() * 60) + (//cml:list[@cmlx:templateRef='cputime']//cml:scalar[@dictRef='x:second']/text()))" />
<transform process="addUnits" xpath=".//cml:scalar[@dictRef='cc:walltime']" value="si:s" />
<transform process="addUnits" xpath=".//cml:scalar[@dictRef='cc:cputime']" value="si:s" />
<transform process="createDate" xpath=".//cml:scalar[@dictRef='cc:dateEnd']" format="yyyy/MM/dd 'at' HH:mm:ss.SSS" />
<transform process="delete" xpath=".//cml:list" />