[Nathan]
2012-01-04 23:23:50
Is there a difference?
2012-01-04 23:23:50
2012-01-04 23:24:39
2012-01-04 23:27:32
2012-01-04 23:35:15
2012-01-04 23:36:09
From: ggzz
Sleep is what you would call I guess Permanent.. You cannot wake up something sleeping sorta like a thread..
Wait should be used when doing conditions..
Example:
Thread.Wait(1000);….. It will still be using up cpu.. whereas Sleep will make it totally shut off and can only be turned back on when you call it again..
Wait = woken up by notify..
Sleep = Interupted.. never awaken.
Kinda hard to explain.. oh gosh I hope someone who is better at teaching can elaborate more/better..
2012-01-04 23:38:50
From: [Nathan]
I understand what you mean I think, but when should you use one vs the other then?
2012-01-04 23:39:50
2012-01-04 23:43:10
From: ShawnjohnSJ
In java, Thread.sleep() is used to sleep for a specific amount of time without being woken up by another Thread. wait() sleeps for a specific amount of time, but it can be woken up by another thread by using notify(). Although I'm not sure if theres much of a difference in SCAR/Simba, it may just be a wrapper function.
2012-01-04 23:58:42
From: [Nathan]
Thats why I was initially confused because I'm used to java, but there isn't multithreading possible with simba, so I didn't know why there would be a difference.
2012-01-05 00:00:21
From: ggzz
Could possibly be the internals.. Simba has some threads in it..
TM.Thread.. PSThread.. etc.. And I THINK you can thread in simba it's just a stupid way of doing it because you cannot access variables.. the idea is the create the thread in a plugin/dll and call it in a script -__-
Anyway I'm sure the Sleep vs Wait won't affect any scripts so I guess it's safe to use either one..