How efficient is this algorithm?

Hmm nice to know it works in a controller or a widget, thanks. But I need it to work specifically on an actor.