Coder Social home page Coder Social logo

compare_sum_and_cc's Introduction

Compare_sum_and_cc

This repo tries to prove that the CC is much more time consuming than summation.

Compile

just make with gfortran:

make

Check the time consuming

We can use the command time to check the time.

3 times tests on Lenovo PC with Centos:

➜  compare_sum_and_cc git:(master) time ./cor
./cor  48.87s user 1.97s system 89% cpu 56.927 total
➜  compare_sum_and_cc git:(master) time ./cor
./cor  49.83s user 2.06s system 85% cpu 1:00.98 total
➜  compare_sum_and_cc git:(master) time ./cor
./cor  49.67s user 2.05s system 85% cpu 1:00.50 total
➜  compare_sum_and_cc git:(master) time ./sum
./sum  2.07s user 0.00s system 85% cpu 2.435 total
➜  compare_sum_and_cc git:(master) time ./sum
./sum  2.02s user 0.00s system 87% cpu 2.328 total
➜  compare_sum_and_cc git:(master) time ./sum
./sum  2.09s user 0.00s system 72% cpu 2.899 total

3 times tests on Macbook Pro:

liang@Pathfinder ~/work/compare_sum_and_cc ±master » time ./cor
./cor  38.71s user 0.60s system 92% cpu 42.556 total
liang@Pathfinder ~/work/compare_sum_and_cc ±master » time ./cor
./cor  37.92s user 0.47s system 96% cpu 39.811 total
liang@Pathfinder ~/work/compare_sum_and_cc ±master » time ./cor
./cor  37.98s user 0.46s system 95% cpu 40.396 total
liang@Pathfinder ~/work/compare_sum_and_cc ±master » time ./sum
./sum  1.59s user 0.02s system 96% cpu 1.672 total
liang@Pathfinder ~/work/compare_sum_and_cc ±master » time ./sum
./sum  1.50s user 0.02s system 97% cpu 1.559 total
liang@Pathfinder ~/work/compare_sum_and_cc ±master » time ./sum
./sum  1.56s user 0.02s system 96% cpu 1.641 total

The "user" is the time of the User Mode. This is just what we need.

The "system" is the time of the System Mode.

The "total" is the real time.

The "cpu" means cpu_usage = (user_time + sys_time)/total * 100%

compare_sum_and_cc's People

Contributors

wangliang1989 avatar

Watchers

 avatar  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.