07-17-2013
Time command issuing all zeroes
I am trying to issue the time command on a program so I can see execution times but it is returning all zeroes. Like this:
time pdriver arg1 arg2
0.000u 0.000s 0:00.00 0.0% 0+0k 0+0io 0pf+0w
"0+0k 0+0io 0pf+0w" --> The "0+0io" may change sometimes to a different number.
How can I run the time command successfully? I'm using a unix terminal and my program is in c++.
Last edited by Don Cragun; 07-18-2013 at 01:14 AM..
Reason: Homework violation. New thread opened in proper forum.
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a filename 'INITIATE_FINAL_ALL_000080889.dat', and I want to capture just the number '80889' from it.
Here is what I have so far:
%> echo INITIATE_FINAL_ALL_000080889.dat | sed "s/*//g"
000080889
Now, I just need to trim off the padded zeroes.
Thanks,
- CB (3 Replies)
Discussion started by: ChicagoBlues
3 Replies
2. UNIX for Dummies Questions & Answers
I wondered if someone could point out the differences between the time commmand and usr/bin/time and the accuracy one might have over another.
Also, is there a website or two a person could maybe link for me to describe the differences?
Thank you for your time. (2 Replies)
Discussion started by: icedrake
2 Replies
3. Shell Programming and Scripting
So, I can't figure out how to do a previous question with printf, so I'm taking a different approach. Suppose I have a set of numbers:
1200,135.000000,12.30100,3212.3200,1.759403,,1230,101.101010,100.000000
I want to remove all trailing zeroes after the decimal, and, if it ends up orphaned,... (8 Replies)
Discussion started by: treesloth
8 Replies
4. Shell Programming and Scripting
I have th following file
0000000011
0000000001
0000000231
0000000001
0000000022
noow when i run the following command
sed 's/^0+//g' file name
I receive the same output and the leading zeroes are not removed from the file . Please let me know how to achieve... (4 Replies)
Discussion started by: asalman.qazi
4 Replies
5. UNIX for Advanced & Expert Users
How can I run a here document on just one line? I ask, because I need to issue it from C++ as a system() or similar command and for security reasons I don't want to write out a shell script file from the program and run it.
For example, how could I write:
passwd test <<EOF
n3wp3ss... (3 Replies)
Discussion started by: BrandonShw
3 Replies
6. Shell Programming and Scripting
I have the following script that renames filenames like:
blah_bleh_91_2011-09-26_00.05.43AM.xls
and transforms it in:
91_20110926_000543_3_blih.xls
for a in *.xls;
do
b="$(echo "${a}" | cut -d '_' -f4)"
dia=`echo ${b} | cut -c9-10`
mes=`echo ${b} | cut -c6-7`
anio=`echo ${b} | cut -c1-4`... (4 Replies)
Discussion started by: Tr0cken
4 Replies
7. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
A common problem arising in games and simulations is to generate a random arrangements of integers from 1 to N.... (5 Replies)
Discussion started by: lamentofking
5 Replies
8. Shell Programming and Scripting
Greetings all,
On a RedHat System - I am issuing a command from script.sh that will add a file extension to a listing of files in a directory. It works, but I need to script from having an extension added as well.
Here is what I have tried to no luck:
for file in `ls * | awk ' /\./{print... (6 Replies)
Discussion started by: jeffs42885
6 Replies
9. UNIX for Dummies Questions & Answers
Hi,
Using ksh, I have set up aliases (which work fine) in my user's .profile like this:
alias ll = 'ls -lrt'
alias cls = 'clear'
How do I call these same aliases so that they will work after issuing this: ? su - user
I do not want to add aliases to the su shell's .profile or .kshrc. (7 Replies)
Discussion started by: ocbit
7 Replies
time(1) General Commands Manual time(1)
NAME
time - time a command
SYNOPSIS
command
utility [argument ...]
DESCRIPTION
When a specified command or utility completes execution, prints the elapsed time during the command or utility, the time spent in the sys-
tem, and the time spent executing the command or utility. Times are reported in seconds.
Execution time can depend on the performance of the memory in which the program is running.
The times are printed to standard error.
Note that the shell also has a keyword that times an entire pipeline if used anywhere in the pipeline. This action is different than the
command which times a particular command if used in a pipeline.
Options
recognizes the following options:
command The command to be executed and timed.
Writes the timing statistics to standard error.
utility The name of a utility to be invoked and timed. If the utility operand names any of the shell special built-in utilities,
the time results are undefined. See csh(1) and ksh(1) for information about special built-in utilities.
argument Any string that is an argument to the utility.
SEE ALSO
csh(1), ksh(1), sh(1), timex(1), times(2).
STANDARDS CONFORMANCE
time(1)