Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8336075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:52:32+00:00 2026-06-09T03:52:32+00:00

i was wondering what is the overhead of using the time command in unix.

  • 0

i was wondering what is the overhead of using the time command in unix.

i know how to use it, but i want to know how much longer the command

$ time java HelloWorld

takes on a terminal, than the command

$ java HelloWorld

I am specifically interested in how this overhead varies with the time duration of the program that is running.

context::
I am using it to measure the time taken for a bunch of long running experiments written in Java.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:52:33+00:00Added an answer on June 9, 2026 at 3:52 am

    The overhead is fixed and, based on the source code, is only due to the fact that an extra process is being started (the time process itself), introducing a small amount of extra processing (a). Normally, the shell would start your program but, in this case, the shell starts time and time starts your process (with a fork).

    This extra processing involves:

    • argument processing.
    • the time taken to fork and exec the child.

    While the process being measured is running, time itself is simply waiting for it to exit (with a wait call) so has no impact on the process.

    So, while the start-up time for the time process is actually included in the measurements, these will only be significant for very short processes. If your process runs for an appreciable amount of time, the overhead of time is irrelevant.

    As to what I mean by appreciable, you can see the effect time has by running it with a very fast executable, and also see if it has any appreciable increase in overhead for longer-running processes:

    pax> time sleep 0
    real    0m0.001s
    user    0m0.000s
    sys     0m0.000s
    
    pax> time sleep 1
    real    0m1.001s
    user    0m0.000s
    sys     0m0.000s
    
    pax> time sleep 10
    real    0m10.001s
    user    0m0.000s
    sys     0m0.004s
    
    pax> time sleep 100
    real    1m40.001s
    user    0m0.000s
    sys     0m0.000s
    

    In other words, hardly any effect at all.

    Now, since you’re only likely to be timing processes if they’re long-running (it’s hard to care whether a single process takes one or two milliseconds unless you’re running it many times in succession, in which case there are better ways to increase performance), the fixed overhead of time gets less and less important.


    (a): And, if you’re using a shell with time built in (such as bash with its time reserved word), even that small overhead disappears.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering if there are any performance overhead issues to consider when using
wondering if some of you know what javascript framework facebook is using ? Thanks
I am wondering what is the memory overhead of java HashMap compared to ArrayList?
I want to use a MKMapView to display the user current location using the
Recently I was trying to determine the time needed to calculate a waveform using
I am wondering what is produced by the compiler when using non-virtual derivation: template<
I was wondering what the differences are between using a Ruby gem to include
As you all know, Hibernate introduces overhead to basically all operations on database due
Instead of using the web services infrastructure provided by .net, I was wondering what
I was wondering if the overhead associated with creating a new class instead of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.