Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

These commands work fine: (calculates time between opening and closing the program)

time gedit
time emacs
time vim 

But this command always gives a time under 1 second. It's probably time which opening the program took.

time gvim
share|improve this question

1 Answer 1

up vote 1 down vote accepted

The GUI version of vim will detach from the foreground terminal by default - you can tell it not to - and so has "exited" from the point of view of the time command.

Detaching means it doesn't block the terminal which, for a GUI application, is a pretty reasonable choice.

Your analysis - that this is roughly the startup time - is on the money.

share|improve this answer
    
What else can I do to evaluate the time for gvim, else than tell it not to detach –  a-z Mar 10 '12 at 18:20
    
There isn't a convenient way to get time(1) to do that other than keep gvim in the foreground, which might be what you want anyhow. You could monitor the process table and track the life of the forked gvim that way, you could use strace and follow forks, and get time that way, or you could do something with cgroups to follow it. Just asking it to stay in the foreground instead is probably the right choice though - time gvim -f ... –  Daniel Pittman Mar 10 '12 at 18:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.