First thing. I don't think using yield in physics process like that is good idea. Because it is creating timers every frame. Try adding print("test") after yield. It will wait for 1 sec, and then just go nuts.
What I see is that you think you should create "timeout" function. That is not the case. First argument is Object (in that case timer) and second argument is SIGNAL from that object that yield is waiting for.
Then, what is yield?
yield(object: Object = null, signal: String = "")
is a method that as documentation says:
"Stops the function execution...bla bla until something"
You can resume function by calling
or you can add object and signal to yield(). That way yield will wait for that object to emit signal. In your case it creates timer and waits for "timeout" signal. It emits after 1 sec, and script resumes.
So for example if you paste code that is shown below. You script on ready will create timer, wait 1 sec, emit signal "timeout" and now yield will know that it needs to resume and will do next thing - print "test".
How can you use it?
In many, many ways. for example you can do function that place bomb on ground when you press button. You put yield in that function with a timer and after timeout do explosion, play animation with AnimationPlayer etc.
PS: in godot 4.0 yield() is called await()