Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » system facilities » cpuTime
next | previous | forward | backward | up | index | toc

# cpuTime -- seconds of cpu time used since Macaulay2 began

- Usage:
    `cpuTime()`
- Outputs:
  - a real number, the number of seconds of cpu time used since the program was started

## Description

    i1 : t1 = cpuTime()

    o1 = 271.178530767

    o1 : RR (of precision 53)

    i2 : for i from 0 to 1000000 do 223131321321*324234324324;

    i3 : t2 = cpuTime()

    o3 = 272.888144266

    o3 : RR (of precision 53)

    i4 : t2-t1

    o4 = 1.709613499

    o4 : RR (of precision 53)

## See also

- time -- time a computation
- timing -- time a computation
- currentTime -- get the current time

## For the programmer

The object cpuTime is a compiled function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/cpuTime-doc.m2:26:0.