Check out this forum post where we discussed why you cannot use cycles.balance and you should use the performance counter instead:
Check out this forum post where we discussed why you cannot use cycles.balance and you should use the performance counter instead: