Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. COI don't think `ACCEPT TIME` in COBOL was ever intended to build a timer function as you have illustrated. What you are doing here is burning CPU at a fantastic rate - on a mainframe system where CPU costs are real you might even be able to bankrupt your employer with this code! Final note: Testing for "not equal" in the loop could possibly lead to an infinite loop. If you are going to do this at least test for `TEMP-TIME-2 > TEMP-TIME-1`
      singulars
    2. CONealB, if you want to help, please offer an alternative. If you object to the perform loop, it can be excluded, but that might reduce the accuracy of the method above. Unless time stops, temp-time-1 <> temp-temp-2 will be true within 1/100th of a second and the loop will stop. I do want to learn: please explain how an infinite loop would happen.
      singulars
    3. COEfficiently implementing a timer cannot not be done using standard COBOL verbs such as `ACCEPT TIME` as you have shown. The tight loop will burn up CPU by making possibly millions of calls to timer servies - just to waste time. The correct way is to issue a call some sort of service routine to suspend your process for the desired amount of time. On a z/os based mainframe you can use either the CEE3DLY or CEEDLYM services to suspend your program - leaving the CPU free to do other things. These are non-standard routines so every OS will require a different type of call.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload