Well, I think the wait time in the trigger node maybe was too long (1 ms)
Here is a modified version that demonstrates how I thought it should work. It measures the time the execution inside the function node takes
[
{
"id": "72f81f8e71a4a22f",
"type": "trigger",
"z": "36f1953be98c4956",
"name": "",
"op1": "",
"op2": "",
"op1type": "date",
"op2type": "nul",
"duration": "0.000000001",
"extend": false,
"overrideDelay": false,
"units": "ms",
"reset": "",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 910,
"y": 1670,
"wires": [
[
"a4e5417642ba9263"
]
]
},
{
"id": "a4e5417642ba9263",
"type": "debug",
"z": "36f1953be98c4956",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1160,
"y": 1670,
"wires": []
},
{
"id": "baeb7091b4dd2fce",
"type": "function",
"z": "36f1953be98c4956",
"name": "",
"func": "//do something\nlet t = msg.payload;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 900,
"y": 1790,
"wires": [
[
"9d38ceb31750d74c",
"72f81f8e71a4a22f"
]
]
},
{
"id": "9d38ceb31750d74c",
"type": "debug",
"z": "36f1953be98c4956",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1160,
"y": 1790,
"wires": []
},
{
"id": "b44d44583e89fa74",
"type": "inject",
"z": "36f1953be98c4956",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "A",
"payload": "just whatever",
"payloadType": "str",
"x": 580,
"y": 1670,
"wires": [
[
"72f81f8e71a4a22f",
"baeb7091b4dd2fce"
]
]
}
]