Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Akow, degenerate_762), 1,430 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Repeating Function #130050
05/15/07 19:05
05/15/07 19:05
Joined: Nov 2006
Posts: 141
South Africa
quasarchangel Offline OP
Member
quasarchangel  Offline OP
Member

Joined: Nov 2006
Posts: 141
South Africa
I have a function that calls itself a few times over and over to get a certain result. Everything in it works, but sometimes it goes into too many functions (of itself) and causes a frame rate spike. So, I want to pause all the current functions for a frame, and then resume.

Now I thought that if I use sleep() at the beginning of the function it would work but its not working. I have a counter which checks how many times the function has been called, my.cur_depth, and I use this to pause it: if(my.cur_depth % 20==0){sleep(1);}
But its not working the same as when it is without the above. Anyone have any ideas of what I could do?


God DID give us a manual on how to change this world...
Re: Repeating Function [Re: quasarchangel] #130051
05/15/07 19:13
05/15/07 19:13
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Well, that's of course as returns do not return anything at all with a wait in front of them. Pass an extra argument as a vector and give the value back with the vector.


Always learn from history, to be sure you make the same mistakes again...
Re: Repeating Function [Re: Uhrwerk] #130052
05/15/07 19:30
05/15/07 19:30
Joined: Nov 2006
Posts: 141
South Africa
quasarchangel Offline OP
Member
quasarchangel  Offline OP
Member

Joined: Nov 2006
Posts: 141
South Africa
Ok, well, I have tried that, or something similar.

It seems that it will be impossible for me to use a function, I'll have to convert it to a loop, and that I really don't feel like doing.

Any idea how much speed gain I would get if I wrote the function in c++ and put it in a dll?


God DID give us a manual on how to change this world...
Re: Repeating Function [Re: quasarchangel] #130053
05/15/07 21:52
05/15/07 21:52
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Totally depends on the function. What about telling us what you exactly want to do?


Always learn from history, to be sure you make the same mistakes again...

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1