Re: COBOL Time of Day in micro-seconds or nano-seconds
- From: Robert <no@xxxxxx>
- Date: Fri, 30 May 2008 19:13:41 -0500
On Fri, 30 May 2008 09:03:32 -0500, "HeyBub" <heybub@xxxxxxxxxxxxxxx> wrote:
don@xxxxxxxxxxx wrote:
All
Does anyone know of a "standard" or widely accepted way to get COBOL
time of day in micro-seconds or nano-seconds for use in generating
more accurate transaction time-stamp and for use in measuring
transaction turn-around time.
The current-date function only returns hundredth of a second.
Using mainframe assembler the micro-second clock counter can be
accessed but that's not standard COBOL and not portable across
platforms. In J2SE Java, there is the method System.nanotime() to get
the more accurate time of day in nano-secounds available from the host
system but that's not standard COBOL either.
On PCs, the best resolution is ghastly, I think it's 16 milliseconds. But
whatever, you're limited to the resolution of the CPU's timer.
The interrupt 10 timer is ancient history. Its resolution was 1/18.2 sec = 56 ms. Intel
and Windows have offered higher resolution timers since the 80386 circa. 1994.
The question seemed oriented to mainframes and/or Cobol. ANS Standard Cobol offers no
solution. The z/OS API does but it's not portable, as stated in the question. So does
POSIX, but it too is tied to one OS family (Unix). I think the best answer is a non-Cobol,
OS-independent one such as GNU C.
Another tack is to get a start time, process 'n' transactions (where 'n' is
a large number), get an ending time then compute an average.
Yep, that's my preferred way. When trying to time a single event or iteration, the
overhead of GETTING the time can be longer than, or a significant percentage of, the event
being timed.
But the question was how to get a high resolution transaction timestamp, which would be
used to order events chronologically or detect collisions.
.
- References:
- COBOL Time of Day in micro-seconds or nano-seconds
- From: don@xxxxxxxxxxx
- Re: COBOL Time of Day in micro-seconds or nano-seconds
- From: HeyBub
- COBOL Time of Day in micro-seconds or nano-seconds
- Prev by Date: Re: Opinions on approach, please...
- Next by Date: Re: Opinions on approach, please...
- Previous by thread: Re: COBOL Time of Day in micro-seconds or nano-seconds
- Next by thread: Re: COBOL Time of Day in micro-seconds or nano-seconds
- Index(es):
Relevant Pages
|