Jump to content

Welcome to Omni-bot Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Photo

Question about sleep command

- - - - -

  • Please log in to reply
2 replies to this topic

#1
Mateos

Mateos

    Senior Member

  • Members
  • 1,053 posts
  • LocationFrance

Good morning,

 

In a map I'm making waypoints for, an objective is reachable 30 seconds after an other one is built.

 

The idea is to avoid reachability issue prints, and IIRC OB is mono-threaded, so a sleep(30) would be a bad thing.

 

What would be recommended? Leave the prints, or make a function which splits the given time, and do a loop with a sleep and yield in it?


mateos1.png


#2
palota

palota

    Senior Member

  • Administrators
  • 501 posts

Omni-bot runs in a single OS thread, but GameMonkey scripts have multiple threads which use cooperative multitasking. Therefore sleep(30) is recommended. Sleep is always better than yield within a loop.


  • Mateos likes this

#3
Mateos

Mateos

    Senior Member

  • Members
  • 1,053 posts
  • LocationFrance

Perfect, thank you :)


mateos1.png





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users