Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

logging script duration with fractions

Hi! Can't get my duration log to register fractions of a second.
LET
SCRIPT_START = now(1);
table1:
LOAD
     1
as F1
AutoGenerate 10000000
;
LET LOAD_DURATION = now(1) - SCRIPT_START;
CALL Log ('Loading table1 took '& interval(LOAD_DURATION,'ss.fff'));

How to format LOAD_DURATION so I get ex. 2.344s?
1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi,

Now() will return seconds as the minimum, not fractions of seconds. So in any case two variables with two different values of Now() will store seconds, that's why fractions are not shown.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

View solution in original post

3 Replies
swuehl
MVP
MVP

Hi Thomas,

interesting issue. If you add a small number to LOAD_DURATION like

interval(LOAD_DURATION+1e-006,'dd:hh:mm:ss,fff')

or use the small number without LOAD_DURATION, the fraction will appear, but only showing the addtional number (I tested this with an variable and text box output, I think LOG is a function defined in your script, right?).

I thought of truncation of LOAD_DURATION during interval evaluation, but my modification shouldn't work then neither.

Also printing LOAD_DURATION and sum of LOG_DURATION+1e-006 looks fine.

So I can't see a problem with the format and use of interval function, I am also clueless. This absolutely does not look logically to me.

Sorry, no real answer 😞

Stefan

Miguel_Angel_Baeyens

Hi,

Now() will return seconds as the minimum, not fractions of seconds. So in any case two variables with two different values of Now() will store seconds, that's why fractions are not shown.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable
Author

Hi Stefan! Log is a subroutine. I'm just, trying to, extend Robs external logging from his cookbook.