Differences

This shows you the differences between two versions of the page.

Link to this comparison view

documentation:language_reference:functions:timestart [2016/10/09 21:56] – created Maurits W. Haverkortdocumentation:language_reference:functions:timestart [2016/10/10 09:41] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== TimeStart ======
  
 +###
 +In order to determine the total time spent in parts of the code one can use timing. The function //TimeStart(a)// starts the clock for the section that follows. The variable //a// should be a string that acts as label for the part of the code you want to time.
 +###
 +
 +===== Input =====
 +
 +###
 +  * a : string
 +
 +###
 +
 +===== Output =====
 +
 +###
 +none
 +###
 +
 +===== Example =====
 +
 +###
 +A small example timing part of the code:
 +###
 +
 +==== Input ====
 +<code Quanty Time.Quanty>
 +dofile("../definitions.Quanty")
 +
 +TimeStart("Eigensystem")
 +Eigensystem(Opp1,psi1)
 +TimeEnd("Eigensystem")
 +
 +TimeStart("Spectra")
 +spec = CreateSpectra(Opp1,Opp2,psi1)
 +TimeEnd("Spectra")
 +
 +TimePrint()
 +</code>
 +
 +==== Result ====
 +<file Quanty_Output Time.out>
 +Timing results
 +   Total_time | NumberOfRuns | Running | Name
 +      0:00:00 |            1 |       0 | Eigensystem
 +      0:00:00 |            1 |       0 | Spectra
 +</file>
 +
 +===== Table of contents =====
 +{{indexmenu>.#1}}
Print/export