Page 1 of 1

Overhead on accepting system time

PostPosted: Tue Apr 23, 2013 12:57 pm
by TaahirZA
Hi

I have a program which every transaction invokes. I would like to know if accepting time from the system will incur any overhead. In other words, is accepting the system time equivalent to an I/O?

Thanks

Re: Overhead on accepting system time

PostPosted: Tue Apr 23, 2013 1:04 pm
by enrico-sorichetti
describe the environment and define the meaning of transaction

Re: Overhead on accepting system time

PostPosted: Tue Apr 23, 2013 1:06 pm
by NicC
That is not the point: the point is where else would you get the system time?

Re: Overhead on accepting system time

PostPosted: Tue Apr 23, 2013 1:17 pm
by TaahirZA
We are running in an IMS environment with an IMS transaction. Getting the time is not a critical aspect of my program, it would be a nice thing to have. If it causes additional I/O, i would rather leave it out.

Re: Overhead on accepting system time

PostPosted: Tue Apr 23, 2013 1:24 pm
by BillyBoyo
Can you explain why it would be "nice to have"? It is needed, or it isn't. How are you going to use the time, for what purpose?

Re: Overhead on accepting system time

PostPosted: Tue Apr 23, 2013 1:27 pm
by TaahirZA
I want to track errors on transactions. It would be nice to use a time stamp to calculate frequency of errors over a time range, but I don't want to incur additional overhead.

Re: Overhead on accepting system time

PostPosted: Tue Apr 23, 2013 1:44 pm
by BillyBoyo
Produce a small batch program which does nothing much but get the time in a loop.

Produce another one which is identical but doesn't get the time.

Run both program with the same number of iterations. Say, 100,000 to start with. Keep going up [or down] until there is a significant difference in CPU used (or IOs, but I doubt it) [or until there is no significant difference in CPU used]. If there is a consistent and noticeable increase in elapsed time that might be something, but elapased time is a fickle beast to measure by (because it depends on so many things).

Assess results from against transaction volumes you system is going to process, per day, per hour, per minute, whatever.

Re: Overhead on accepting system time

PostPosted: Tue Apr 23, 2013 10:13 pm
by dick scherrer
Hello and welcome to the forum,

If the time provides value (and it sounds like it does), get the time. You will probably not be able to measure the difference on a per-transaction basis. I'm assuming COBOL and using the internal function(s) rather than calling some subroutine.
Read here:
http://publibz.boulder.ibm.com/cgi-bin/ ... 50/6.2.1.2

Re: Overhead on accepting system time

PostPosted: Wed Apr 24, 2013 12:57 am
by pmartyn
Dick raises a good point. 'If the time provides value' and apparantly so. .
There seems to be some confusion as to what triggers I/O. To answer that we have to remind ourselves about Mainframe System Configuration.
I/O is typically generated when retrieving information is not in main storage (i.e.Disk). Since the System Clock is already in 'Main' Storage your retrieval should not cause any substantial overhead.

Here is the link provided by dick on how to retrieve the time using COBOL.
http://publibz.boulder.ibm.com/cgi-bin/ ... 50/6.2.1.2

Re: Overhead on accepting system time

PostPosted: Wed Apr 24, 2013 1:06 am
by Robert Sample
1. Accepting the system time is going to require fewer system resources than an I/O. CPU activities take nanoseconds while I/O activities require milliseconds (or possibly microseconds in these days of cached disk activity).
2. The system overhead involved in "invoking" your program (whether CICS or IMS or whatever) will be, probably, orders of magnitude (that is, hundreds to thousands) of times more resource-intensive than accepting the system time.