Nodes/MTB Nodes/End Clock (mtb)
ComfyUI Node Runs on cloud

End Clock (mtb)

Stop a timer and see how long that part of your graph took

By melMass·Created 3 years ago·Updated about a month ago· 723
End Clock (mtb)
  • passthrough
  • passthrough
  • name
  • seconds
  • milliseconds
clock_id

If you've ever wanted to know which section of a big ComfyUI workflow is actually eating your time - the upscale pass, a specific sampler, a chain of detailers - End Clock is MTB's answer to that without leaving the graph. Straight from the node's own description: it "stops a profiling clock identified by its ID and returns the elapsed time in milliseconds," and it errors if that clock ID isn't found or was already stopped.

How it's meant to be used

This node is one half of a pair - it pairs with a matching Start Clock node elsewhere in MTB Nodes that begins timing under the same ID. Drop a Start Clock right before the section of your graph you want to measure, an End Clock right after it, give both the same clock_id, and run the workflow. End Clock hands back the elapsed time between the two, so you can compare, say, how long your sampler takes versus how long your upscaler takes without guessing from wall-clock feel.

The inputs and outputs that matter

  • clock_id (STRING, required) - must match the ID used on the corresponding Start Clock. This is how the two nodes find each other; there's no other pairing mechanism.
  • passthrough (optional, any type *) - lets you wire this node inline on an existing connection without breaking your graph's data flow. Whatever you wire in comes straight back out unchanged, alongside the timing data, so you don't need a separate branch just to measure something.

It returns four things: passthrough (whatever you wired in, unchanged), name (the clock's ID, echoed back as a string), seconds, and milliseconds - the elapsed time in two units, so you can pick whichever is more readable for the scale you're measuring.

Installing it

ComfyUI Manager: search MTB Nodes, install, restart. By hand:

cd ComfyUI/custom_nodes
git clone https://github.com/melMass/comfy_mtb

then restart ComfyUI. No models involved - this is a stopwatch, not inference.

Common issues

The error condition is baked directly into the node's own description, and it's the one thing worth planning around: it errors if the clock ID isn't found, or is already stopped. Two situations trip this in practice - queuing the same workflow again quickly, before you've confirmed the first run's clocks have been reset, and wiring two End Clock nodes to the same clock_id (only one gets to stop it; the second finds nothing left running and errors). Keep clock IDs unique per timed section, and don't reuse one across parallel branches of the graph that might both try to stop it.

And the pack-wide behavior worth knowing regardless of which mtb node you're using: it logs [comfy_mtb] Some nodes (N) could not be loaded at startup instead of crashing outright when a node fails to import, with a pointer to http://127.0.0.1:8188/mtb for the actual cause - a real, confirmed pattern from other users' install logs. If End Clock (or its Start Clock counterpart) doesn't show up after installing, check that line before reinstalling the pack.

Categorymtb/utils

Inputs (2)

NameTypeDefaultDescription
clock_idSTRING
passthroughopt*

Outputs (4)

NameTypeDescription
passthrough*
nameSTRING
secondsFLOAT
millisecondsINT