hell & mathematics

I've been able to generate output based on the code scarfake provided me (thanks again man).

A little background so everyone more or less knows whats going on:

I needed code that would propagate a database with 100,000 entries, for capacity testing purposes, something like a stress test.

Now I have the results based on timestamps. The timestamps are shown as [1211425845].

[22445] [1211425845](1Jz1CX-0007Qa-7X) MINE::EXIMDB::SF::wblist_check BEGIN
[22445] [1211425846](1Jz1CX-0007Qa-7X) MINE::EXIMDB::SF::wblist_check END

I was told these timestamps are in seconds. Which means the above output equates to a 1 second interval from beginning (BEGIN) to end (END).

If anyone can provide code that would do the math showing how many second(s) intervals per BEGIN and END.

My grep command might help:

grep "BEGIN\|END" /mine/output.log

Thanks for looking :slight_smile:

Is your expected output is something like this ?

$  sed -n '/BEGIN\|END/ s_\[\(.*\)\].*\[\(.*\)\].*_\2_p' og.txt
1211425845
1211425846

//Jadu

awk '$NF=="BEGIN"{a=substr($0,10,10)}$NF=="END"{print substr($0,10,10)-a}' data.file

Jaduks, yes that is the expected output.

danmero, that code did it, strange now that I see 0's in the results, goes to show that we need to put more stress into the tests!

Thanks guys :):b::b:

Add nanoseconds to timestamps for precision.

Thanks for the tip, I'll look into that.