Counting Cogs
doggiedoc
Posts: 2,245
I was wondering if there is a built in way to know how many cogs are being used? My project has gotten more complex and I am relying on numerous objects written by others. Is the only way to know to go through all the code of each object and child-objects and count the number of cognews?
Thanks!
Doc
Thanks!
Doc
Comments
Assuming your program starts up OK, you can determine the number of free cogs by calling cognew until it returns a -1. If you store the return values from the successful calls to cognew you can then call cogstop to free up those cogs.