On 8 June 2015 at 14:25, Janet Graff
<[email protected]> wrote:

> I’d like to show this as “Your procedure took nn.nn.n.n microseconds”,or some 
> variation on this
> theme.

I'm not sure if your question is mostly a technical how-to, or more
about output formats. Seems to me there is a decision to be made about
whether you want to display a single decimal number, perhaps with a
decimal point, or a number in mixed-base format such as hours,
minutes, seconds, fraction. Both are common, and it's not uncommon to
change the format on the fly depending on the value of the data.
Neither is hard to implement, so I'd spend the time on making the
output clear and easy to understand at a glance.

Your examples have these values in decimal seconds (truncated to the
microsecond):

0.401559
0.073935

so just showing them that way might be quite reasonable. You'd want to
identify the units, so perhaps along the lines you suggest:

Your procedure took 0.401559 seconds.
Your procedure took 0.073935 seconds.

If you have mostly smaller numbers, you could make the base unit, say,
milliseconds:

Your procedure took 401.1559 milliseconds.
or
Your procedure took 73.935 mS.

On the other hand, particularly if your values might occasionally go
over a minute, (or an hour or a day!), you might prefer

Your procedure took 00:01:02.345678 (hh:mm:ss.ssssss)
or even
Your procedure took 1 Min 2.345678 Sec

If your numbers are rarely over a handful of seconds, I think the
single decimal number of seconds is the best bet; clear and
unambiguous. And you don't have to muck with mixed-base conversion. As
others have said, if microsecond precision is good enough -- which it
surely is when showing elapsed rather than CPU time -- all you need to
do to implement this is SR[D]L 12 bits and then CVD + ED (or EDMK)
instructions. Examples in Principles of Operation, Appendix A, or
someone here will doubtless be happy to provide one.

Tony H.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to