---
title: "speed(by:duration:)"
framework: spritekit
role: symbol
role_heading: Type Method
path: "spritekit/skaction/speed(by:duration:)"
---

# speed(by:duration:)

Creates an action that changes how fast the node executes actions by a relative value.

## Declaration

```swift
class func speed(by speed: CGFloat, duration: TimeInterval) -> SKAction
```

## Parameters

- `speed`: The amount to add to the node’s speed.
- `duration`: The duration of the animation.

## Return Value

Return Value A new action object.

## Discussion

Discussion When the action executes, the node’s speed property animates to the new value. This action is reversible; the reverse is created as if the following code is executed:

## See Also

### Controlling the Action’s Speed

- [speed(to:duration:)](spritekit/skaction/speed(to:duration:).md)
