Page 1 of 1

Elapsed Time of Process

Posted: Thu Jun 02, 2011 1:44 pm
by ellissj3
Hello,

I have been trying to create the elapsed time in seconds that it would take an existing process to complete running (namely an overnight process). I know this is calculated within the Message Log, but I would like to put this in a control cube. Any Ideas on how to accomplish this within a process?

Thank you!

Re: Elapsed Time of Process

Posted: Thu Jun 02, 2011 2:04 pm
by tomok
Are you saying you want to record how long it takes to run a process and store that value in a control cube? It would be easier to record the start and stop times in the control cube and then calculate the elapsed time via a rule in the control cube. Just CellPutN the value from the NOW() function into the starting time cell in control cube on the Prolog tab and then CellPutN the NOW() value in the ending time cell on the Epilog tab. I'll let you take a stab at writing the rule. Hint: Subtract the two dates and then use TIMST function to format as desired.

Re: Elapsed Time of Process

Posted: Thu Jun 02, 2011 3:10 pm
by qml
At the beginning of Prolog add this line:

Code: Select all

nStartTime = NOW;
At the end of Epilog add this line:

Code: Select all

nElapsedSeconds = ROUND ((NOW - nStartTime) / 0.000011574074074074);
Then just write nElapsedSeconds to a cube and you're done. It will give you the execution time rounded to full seconds.