Function node sends multiple messages instead of one

Add debug nodes to the outputs of the inject and the speed nodes. Do they also show the same frequency of messages?

Also, your flow is corrupt as you have not wrapped it in a code fence.

Canned Text:
In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```)

``` 
   code goes here 
```

You can edit and correct your post by clicking the pencil :pencil2: icon.

See this post for more details - How to share code or flow json