Thanks everyone!
// Three seconds, plus one extra second for every 10 themes.
$timeout = MINUTE_IN_SECONDS / 20 + (int) ( count( $themes ) / 10 )
I think MINUTE_IN_SECONDS / 20
is also too complicated :) Keeping that as is, especially with the "Three seconds" comment above, seems more readable to me:
// Three seconds, plus one extra second for every 10 themes.
$timeout = 3 + (int) ( count( $themes ) / 10 );
Same goes for this:
'timeout' => $doing_cron ? MINUTE_IN_SECONDS / 2 : MINUTE_IN_SECONDS / 20,
This might be more readable:
// Half a minute when doing cron tasks, 3 seconds otherwise.
'timeout' => $doing_cron ? MINUTE_IN_SECONDS / 2 : 3,