GithubHelp home page GithubHelp logo

cputime.jl's Introduction

CPUTime.jl

Build Status

A Julia package for measuring elapsed CPU time in Julia.

Installation

You should only use this package if you know what you're doing - CPU time on multi-core processors is a tricky beast. Please at least read the discussion in Issue #1 before proceeding. Once you've done that, to install call:

Pkg.add("CPUTime")

from the Julia command line.

Functions and Macros

The exported functions and macros, as well as their absolute time equivalents, are listed in the following table.

Real time (Julia standard library) CPU time (CPUTime.jl)
time_ns() CPUtime_us()
tic() CPUtic()
toq() CPUtoq()
toc() CPUtoc()
@time @CPUtime
@elapsed @CPUelapsed

Note that the finest resolution for CPU time is microseconds, as opposed to nanoseconds for absolute time.

Usage Example

using CPUTime

function add_and_sleep()
    x = 0
    for i in 1:10_000_000
        x += i
    end
    sleep(1)
    x
end

@time @CPUtime add_and_sleep()
elapsed CPU time: 0.000174 seconds
  1.005624 seconds (32 allocations: 1.109 KiB)
50000005000000

cputime.jl's People

Contributors

robertfeldt avatar schmrlng avatar tkelman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.