API ReferenceGE Extensionsflowgraphnodesutil
Time
- **Node Name:** `Time`
Overview
- Node Name:
Time - Category:
provider - File:
extensions/flowgraph/nodes/util/time.lua
Provides the current time and frame delta times. As a provider category node, it requires no flow input and continuously outputs timing data.
Pin Schema
Output Pins
| Pin | Type | Description |
|---|---|---|
time | number | Time since start of project (high-precision clock) |
dtReal | number | Real elapsed time between frames in seconds (ignores pause) |
dtSim | number | Simulation elapsed time in seconds (0 when paused, scaled with slow-motion) |
Internals
Key Methods
| Method | Description |
|---|---|
init(mgr) | Empty initialization |
work() | Reads time values from os.clockhp() and the flowgraph manager |
Time Sources
time: Usesos.clockhp()- high-precision real-time clock.dtReal: Fromself.mgr.dtReal- wall-clock delta, unaffected by pause or slow-motion.dtSim: Fromself.mgr.dtSim- simulation delta, respects pause state and time scaling.
How It Works
- Every frame,
work()updates all three output pins. os.clockhp()provides absolute time (useful for measuring durations).dtRealanddtSimcome from the flowgraph manager's frame timing.- No input pins needed - the node is a passive data provider.
Usage Example
-- Measure elapsed time:
-- Connect 'time' output to a variable, compare across frames
-- Frame-rate independent animation:
-- Use dtSim for simulation-aware timing
-- Use dtReal for UI/HUD timing that ignores pause
-- Accumulate time in a custom node:
-- self.elapsed = self.elapsed + dtSim
-- Equivalent to building a timer from delta timeKey Dependencies
os.clockhp()- high-precision clockself.mgr.dtReal/self.mgr.dtSim- flowgraph manager timing
See Also
- Route Distance (Flowgraph Node) - Related reference
- Closest Road (Flowgraph Node) - Related reference
- Custom Lua (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide