---
title: "duration-multiplied-by-duration"
description: "Detect multiplication of two time.Duration values."
image: "https://strider.gempir.com/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://strider.gempir.com/llms.txt
> Use this file to discover all available pages before exploring further.

# duration-multiplied-by-duration

**Default severity:** `warning`

`time.Duration` is a scalar count of nanoseconds. Multiplying two duration
values produces squared time units, which is almost never meaningful. This
often happens when a value that was expected to be a unitless count has already
been converted to a duration.

## Bad

```go
delay := duration * time.Second
```

## Good

```go
delay := time.Duration(count) * time.Second
```

Source: https://strider.gempir.com/analyzers/duration-multiplied-by-duration/index.mdx
