I think you are looking for this:
yield(get_tree().create_timer(5.0), "timeout")
Where the float passed to the create_timer()
function is the amount of time that will be yielded. BUT BE CAREFULL WITH THIS. If you change scenes while this is yielding, it will crash your game in release. I think they are planning on fixing this in Godot 4.0, but for now, be aware of it.
If you want to yield for one or more physics frames, I think it's best to just use a counter.
var counter = 0
var frames_to_wait = 1
func _physics_process(delta):
if counter >= frames_to_wait:
'do something'
counter += 1
Finally, if these don't answer your question, check out the docs on using the yield function:
https://docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_basics.html#coroutines-with-yield