# "Measuring diferrences between WHERE and ACCEPT"

**URL:** <https://techcommunity.softwareag.com/t/measuring-diferrences-between-where-and-accept/75529>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Code-Samples, Inside-Natural-and-Performance-Hints\
**Created:** [October 18, 2007, 1:40am UTC](https://techcommunity.softwareag.com/t/measuring-diferrences-between-where-and-accept/75529 "2007-10-18T01:40:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antonio1](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@Antonio1](https://techcommunity.softwareag.com/u/Antonio1)\
**Post date:** [October 18, 2007, 1:40am UTC](https://techcommunity.softwareag.com/t/measuring-diferrences-between-where-and-accept/75529/1 "2007-10-18T01:40:04Z")

</div>

Hi guys,

I need some help in the next topic: How do I measure the NATURAL behavior between two programs, the first one using the WHERE clause, against another using the ACCEPT statement ?

The rest of both programs are identical…

Please, let me know if exist any SAG product that satisfy the requirement…

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [October 18, 2007, 3:44am UTC](https://techcommunity.softwareag.com/t/measuring-diferrences-between-where-and-accept/75529/2 "2007-10-18T03:44:16Z")

</div>

Here is a timing program and output

DEFINE DATA LOCAL  
1 MYVIEW VIEW OF EMPLOYEES  
2 NAME  
1 #NUM (P3)  
1 #COUNTER (P5)  
1 #CPU-START (P9)  
1 #CPU-END (P9)  
1 #CPU-ELAPSED (P9)  
END-DEFINE  
\*  
INCLUDE AATITLER  
INCLUDE AASETC  
\*  
MOVE \*CPU-TIME TO #CPU-START  
STARTA. SETTIME  
READR. READ MYVIEW WHERE NAME = ‘XX’  
IGNORE  
END-READ  
WRITE 5T ‘WHERE TIME: ’ \*TIMD (STARTA.)  
COMPUTE #CPU-ELAPSED = _CPU-TIME - #CPU-START  
WRITE 5T ‘ELAPSED CPU TIME’ #CPU-ELAPSED // 5T '_’ (45)

* * *

- 

MOVE \*CPU-TIME TO #CPU-START  
STARTB. SETTIME  
READR2. READ MYVIEW  
\*  
ACCEPT IF NAME = ‘XX’  
IGNORE

END-READ  
WRITE // 5T ‘ACCEPT TIME ’ \*TIMD (STARTB.)  
COMPUTE #CPU-ELAPSED = _CPU-TIME - #CPU-START  
WRITE 5T ‘ELAPSED CPU TIME’ #CPU-ELAPSED // 5T '_’ (45)

- 

END

```
PAGE # 1 DATE: Oct 17, 2007
PROGRAM: WHERE01 LIBRARY: BOST-SIX

WHERE TIME: 1
ELAPSED CPU TIME 5

*********************************************

ACCEPT TIME 1
ELAPSED CPU TIME 7

*********************************************

```

Basically what this shows is that the difference is probably the “overhead” of entering the READ loop. Actually, it does not “show” it. I should have written out \*COUNTER after each loop.

steve

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:48pm UTC](https://techcommunity.softwareag.com/t/measuring-diferrences-between-where-and-accept/75529/3 "2021-04-02T14:48:50Z")

</div>


