Re: accept ... from time




<michael.bierenfeld@xxxxxx> wrote in message
news:1169554701.175132.59070@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,

I want to measure the execution time of a sql statement. Can I get the
time in milliseconds to be displayed.

I have

accept START-TIME from time

EXEC SQL SELECT ... something

accept END-TIME from time

DISPLAY "EXECUTION lasted from" START-TIME
DISPLAY " till " END-TIME

START-TIME and END-TIME is pic x(8) this is hh24:mm:ss. But I need
fractions of seconds. How can I do this. Target System is Microfocus
and AIX.

I have used the following for timing.
Resolution is 10 ms for code; but may be different
depending on hardware, OS, etc. For example,
a PC with DOS has a resolution of 55 ms.

-----
data division.
working-storage section.
01 t-start.
03 t-start-hour pic 99.
03 t-start-minute pic 99.
03 t-start-second pic 99v99.
01 t-end.
03 t-end-hour pic 99.
03 t-end-minute pic 99.
03 t-end-second pic 99v99.
77 t-elapsed pic 9(7)v99.
77 t-elapsed-display pic z(6)9.99.
procedure division.
...
accept t-start from time

* insert what is to be timed, here

accept t-end from time
perform display-elapsed
...

display-elapsed section.
if t-start > t-end
* execution past midnight
move 86400 to t-elapsed
else
move 0 to t-elapsed
end-if
compute t-elapsed = t-elapsed
+ (t-end-hour - t-start-hour) * 3600
+ (t-end-minute - t-start-minute) * 60
+ (t-end-second - t-start-second)
end-compute
move t-elapsed to t-elapsed-display
display t-elapsed-display
.
-----



.



Relevant Pages

  • Re: accept ... from time
    ... I want to measure the execution time of a sql statement. ... DISPLAY "EXECUTION lasted from" START-TIME ... two such statements in sequence to see what the latent delay is and as ...
    (comp.lang.cobol)
  • Re: Migrating ISAM to Relational Database
    ... 77 t-elapsed-display pic z9.99. ... 03 variable-entry pic x occurs 0 to max-size ... accept t-start from time ... display "variable " with no advancing ...
    (comp.lang.cobol)
  • Re: Migrating ISAM to Relational Database
    ... 77 t-elapsed-display pic z9.99. ... 03 variable-entry pic x occurs 0 to max-size ... accept t-start from time ... display "variable " with no advancing ...
    (comp.lang.cobol)
  • Disabling runtime warnings for standalone executables
    ... I'm using Matlab R14SP3 to compile a standalone executable on Linux. ... Warning: Unable to open display, ... biggie, though, since it only appears the first time the execution is ...
    (comp.soft-sys.matlab)
  • Re: How to determine at runtime where the application is launched from
    ... >> I notice some .exe program under \WIndows folder ... >> when i click on them, the display a dialog shows the version info ... >> and when i type their names in a command prompt, ... Since the program's execution name is argv, ...
    (microsoft.public.vc.language)