Go to the first, previous, next, last section, table of contents.

### `cputime`, `tstart`, `tstop`

`cputime(onoff)`
  :: Stop displaying `cputime` if its argument is 0, otherwise start displaying `cputime` after every top level evaluation of Asir command.
`tstart()`
  :: Resets and starts timer for CPU time and GC time.
`tstop()`
  :: Stops timer and then displays CPU time GC time elapsed from the last time when timer was started.

return
  0
onoff
  flag (arbitrary)

- Command `cputime()` with NON-ZERO argument enables Asir to display CPU time and GC time after every evaluation of top level Asir command. The command with argument 0 disables displaying them.
- Command `tstart()` starts measuring CPU time and GC time without arguments. The parentheses ``()'` may be omitted.
- Command `tstop()` stops measuring CPU time and GC time and displays them without arguments. The parentheses ``()'` may be omitted.
- Command `cputime(onoff)` has same meaning as `ctrl("cputime",onoff)`.
- Nested use of `tstart()` and `tstop()` is not expected. If such an effect is desired, use `time()`.
- On and off states by `cputime()` have effects only to displaying mode. Time for evaluation of every top level statement is always measured. Therefore, even after a computation has already started, you can let Asir display the timings, whenever you enter the debug-mode and execute `cputime(1)`.

    [49] tstart$
    [50] fctr(x^10-y^10);
    [[1,1],[x+y,1],[x^4-y*x^3+y^2*x^2-y^3*x+y^4,1],[x-y,1],
    [x^4+y*x^3+y^2*x^2+y^3*x+y^4,1]]
    [51] tstop$
    80msec + gc : 40msec

`References`
  section `time`, section `currenttime`, section `ctrl`.

Go to the first, previous, next, last section, table of contents.