{{tag>proxy function time}}
====== timeex() ======
Returns the time in seconds since the moment it was triggered.
===== Usage & Examples =====
This function can be used for anything that needs to reset on start and increase over time.
==== Clamp ====
**clamp(5 + timeex(), 5, 10)**
----
When shown, the proxy starts at 5 and increases over time thanks to timeex(), clamp(input, min, max) is used to limit the output so the value never goes above 10.
==== Rainbow Color ====
hsv_to_color(timeex() * 50)
----
Here timeex() is used as the (h)ue input for hsv_to_color(h, s, v) which changes the color over time. Multiplying the timeex() by 50 speeds up the color transition.
{{fa>download?color=#7ab353&fw&lg}} **Download:** {{:part:proxy:hsv.txt}}
==== Loop ====
**timeex()*10%100**
----
This example goes up by 10 every second and loops from 0 to 100.
==== Ping Pong Loop ====
**sin(timeex())*25**
----
This example goes back and forth between -25 and 25.
{{fa>download?color=#7ab353&fw&lg}} **Download:** {{:part:proxy:proxy_ping_pong.txt}}
===== Similar functions: =====
{{topic>proxy +function +time}}