set_time_limit() works in CLI scripts.
set_time_limit(1); //in seconds
After one second returns with the following error message:
PHP Fatal error: Maximum execution time of 1 second exceeded in \
/home/stivlo/test.php on line 4
Initially I tried with sleep() and the time limit doesn't get applied. As @Jon suggested, using a real computation, like an infinite loop works.
Hope it helps!!