# Create delay loop in ruby?

**URL:** <https://www.ruby-forum.com/t/create-delay-loop-in-ruby/155961>\
**Category:** Ruby\
**Created:** [December 18, 2008, 3:43pm UTC](https://www.ruby-forum.com/t/create-delay-loop-in-ruby/155961 "2008-12-18T15:43:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pietia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/d07c76/32.png) [@pietia](https://www.ruby-forum.com/u/pietia)\
**Post date:** [December 18, 2008, 3:43pm UTC](https://www.ruby-forum.com/t/create-delay-loop-in-ruby/155961/1 "2008-12-18T15:43:02Z")

</div>

i am trying to run an executable file(say a.exe) which will produce a  
a.log once finish.so i create the algo below to analyze the log file.

if(a.exe exist)  
execute a.exe

```
if(a.log exist)
  analyze a.log
 end

```

end

but, my thinking is the checking for a.log exist will be done way before  
the a.exe is finished.

any workaround for my problem? i was thinking of using a delay(if can)  
though it is not so reliable…

---

<div class="post-metadata">

**Author:** ![pietia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/d07c76/32.png) [@pietia](https://www.ruby-forum.com/u/pietia)\
**Post date:** [December 18, 2008, 4:05pm UTC](https://www.ruby-forum.com/t/create-delay-loop-in-ruby/155961/2 "2008-12-18T16:05:12Z")

</div>

2008/12/18 Xx Xx [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> but, my thinking is the checking for a.log exist will be done way before  
> the a.exe is finished.
> 
> any workaround for my problem? i was thinking of using a delay(if can)  
> though it is not so reliable…

Just invoke the process synchronously, e.g. via “system”.

robert
