You will still be charged. So you will pay them for the time a function takes to complete its execution or when you have the set the timeout. Calling sleep() won’t stop the execution of the function, so you will still be charged for that time too. Make sure, you stop your function after your functions task completes and set the function timeout accordingly.