brainpy.tools.others.timeout#

brainpy.tools.others.timeout(s)[source]#

Add a timeout parameter to a function and return it.

Parameters

s (float) – Time limit in seconds.

Returns

func – Functional results. Or, raise an error of KeyboardInterrupt.

Return type

callable