LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-16-2008, 08:28 PM   #1
UltraSoul
Member
 
Registered: Dec 2004
Location: Japan
Distribution: REDHAT9.0, Mandrake10.1
Posts: 404

Rep: Reputation: 31
how to calculate program excecute time.


I created one shell to calculate the program exceution time.

END=`date +%s`
sleep 30
START=`data +%s`
TIME="expr $END - $START"
echo "Process Time: $TIME"

However, the calculation just can gime the time with second level.
I wonder how to calculate the time with ms even more accurately.


Thank u.
 
Old 04-16-2008, 08:41 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Does the time command do what you need? An example would be:
Code:
time ls -l /lib
{output removed}
real    0m0.004s
user    0m0.004s
sys     0m0.000s
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
need a program of c made in linux to calculate a raised to the power b using pow fun mona_iitr Programming 5 03-28-2007 08:56 AM
get or calculate mp3 songs time unabia Linux - Software 3 12-04-2006 07:29 PM
calculate time difference between 2 formatted timestamps nickleus Linux - General 3 05-12-2006 10:08 PM
shell script to calculate the time a user is logged in racer_mec Linux - Newbie 2 02-08-2005 11:40 AM
Excecute at boot time... L0CTiT3 Linux - Security 4 12-16-2002 02:51 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration