Code Monkey home page Code Monkey logo

clocks's Introduction

Code to test various clocks under Linux (and OSX)

Some quick notes on the code:

  • The ClockTest.sh script compiles the code, and executes the test programs. It uses taskset to ensure that the tests don't migrate to different CPUs. (taskset is done only for the C++ test – the JVM uses so many threads that pinning them all to a single CPU is probably not a good idea). You'll need to modify the script to specify the correct location for JAVA_HOME on your system, or set JAVA_HOME prior to calling the script.

  • The script detects whether the rdtscp instruction is available by querying /proc/cpuinfo. If not, it bypasses that code (which would otherwise throw a SIGILL).

  • You can also pass in the CPU frequency, in GHz. If you don't, then a frequency of 1 is used, which has the effect of returning the tick count unmodified for those clock sources that use tick counts (i.e., anything having to do with the RDTSC instruction).

  • If the script doesn't seem to be working, execute it with “bash -xv ClockTest.sh” to see the actual commands.

© Copyright 2014 by Bill Torpey. All Rights Reserved.

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

clocks's People

Contributors

btorpey avatar wallstprog avatar

Watchers

James Cloos 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.