If it's a one-time maintenance issue then run the code manually at a time you chose.
If it's a periodic maintenance task that might be heavy, use unix cron.
Otherwise, wp-cron can be used. You're probably using it more than you know already. This plugin is great for monitoring wp-cron.