06-06-2006
Here goes one of the solution
Step1-->"2006-05-30_13:14:04,256"--> store year, month, day, hour, min, seconds, milliseconds into seperate varables
Step2-->t1 = mktime(year" "month" "day" "hour" "min" "seconds)
Step3-->tStart = (t1*1000)+milliseconds
Now i have timestamp in milliseconds....follow the same three steps for the end time(tEnd).
tEnd-tStart-->gives the delay in milliseconds
10 More Discussions You Might Find Interesting
1. Programming
Hi,
I need to time a certain function in my C/C++ code and I am experiencing some difficulties. I timed it using wallclock time so I know that it takes approximately 500-600 microseconds with
gettimeofday(&start, NULL);
// my function call
gettimeofday(&end, NULL);
answer = (end.tv_sec -... (2 Replies)
Discussion started by: zynnel
2 Replies
2. Shell Programming and Scripting
1.56.253.48 - - "GET "
1.6.253.48 - - "GET "
1.65.253.48 - - "GET "
1.65.253.48 - - "GET "
1.63.53.48 - - "GET "
1.65.253.48 - - "GET "
1.16.23.48 - - "GET "
1.64.25.48 - - "GET "
need command which give the output
1.6.253.48 - 09/Nov/2009:07:02:24
1.65.253.48 -... (7 Replies)
Discussion started by: sagar_evc
7 Replies
3. Shell Programming and Scripting
hi,
I am a new awk user, now i want to change my result from
1 ca 0.2057422D-01 -0.7179106D-02 -0.5600872D-02
2 o 0.2463722D-01 -0.1554542D-01 0.3110649D-01
3 h -0.1068047D-01 0.1016889D-01 -0.4088230D-02
to
1 ca 0.02057422 -0.007179106 -0.005600872
2 o 0.02463722 -0.01554542 ... (4 Replies)
Discussion started by: wanchem
4 Replies
4. Shell Programming and Scripting
Hi,
Could anyone help me to solve this problem?
I have two files "f1" and "f2" having 2 fields in each, a) file size and b) file name. The data are almost same in both the files except for few and new additional lines. Now, I have to find out and print the output as, the difference in the... (3 Replies)
Discussion started by: royalibrahim
3 Replies
5. Shell Programming and Scripting
Hi All,
could any body let me know.
how to get timestamp with millisecond precision in unix bash shell.
example -->2005-12-06- 4-22-35-195
please help me.
Thanks,
Krupa:wall: (3 Replies)
Discussion started by: krupasindhu18
3 Replies
6. Shell Programming and Scripting
Why the below option2 doesn't fetch similar output as option1 ? I am on linux.
$cat test
2013-01-01-00.25.43.643845
Option1:
cat test | gawk -F"-" ' {print $2 " " $3 " " $1}'
01 01 2013
Option2:
cat test | gawk '{FS="-"} {print $2 " " $3 " " $1}'
2013-01-01-00.25.43.643845 (5 Replies)
Discussion started by: Shivdatta
5 Replies
7. Shell Programming and Scripting
Hi all,
Need an urgent help on the below scenario.
script:
awk -F","
'BEGIN { #some variable assignment}
{ #some calculation and put values in array}
END {
year=#getting it from array and assume this will be 2014
month=#getting it from array and this will be 05
date=#... (7 Replies)
Discussion started by: vijaidhas
7 Replies
8. Shell Programming and Scripting
Hi All,
Solaris 10 o/s
With your help I developed the following script.
find /oracle/diag/rdbms/*/*/trace -type f -name '*d00*.trc' -mtime 0 -exec egrep –c 'NS Primary Error' '{}' '+'
which returns the counts I needed nelow:
/oracle/diag/rdbms/musidp/musidp/trace/abcdef_d001_21751.trc:15... (9 Replies)
Discussion started by: bdby
9 Replies
9. UNIX for Advanced & Expert Users
Hello, am not able to subtract timestamps in milliseconds.
I extract the timestamp as a string, and then try to subtract the two, but since it is a string, system just outputs 0
awk -F"," 'substr($1,0,13) - substr($2,0,013)' File
where $1 and $2 are the timestamps in the format... (4 Replies)
Discussion started by: sidnow
4 Replies
10. UNIX for Beginners Questions & Answers
Hello,
In HP-UX how to find the date time difference ?
Start time: 28-APR-2019 21:36:01
End time : 29-APR-2019 00:36:04
----------------------
Difference is
----------------------
Much appreciate any pointer or view on this.
... (3 Replies)
Discussion started by: Siva SQL
3 Replies
IGAWK(1) Utility Commands IGAWK(1)
NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO
gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
Free Software Foundation Nov 3 1999 IGAWK(1)