# What duration units does CQL accept, only minutes?

Asked by Owen Fitzgerald on 2024-10-09. Tags: cql, audiences, session.

Saw this in the docs and it works fine:

```cql
session's duration > 5 minutes
```

I wanted a stricter threshold for a course-completion nudge so I tried a couple
variations with seconds before checking anything. Some parsed, some I wasn't
sure about. So before I keep guessing:

- what duration units actually exist?
- do durations only work with `session's duration` or can I use them elsewhere?

also does casing matter, I wrote `Minutes` at one point and it still seemed fine

## 1 answer

### Answer from delia (2024-10-10)

Durations are first-class literals in CQL, not something special-cased for
sessions. `5 minutes` is a value like any number or string, so it works anywhere
a duration comparison makes sense and composes with other clauses:

```cql
session's duration > 5 minutes and session's stats' orders is 0
```

On casing: CQL keywords are case-insensitive (string literals are not), which is
why `Minutes` parsed. Evaluation targets under 20ms, so there is no performance
reason to avoid duration checks either, they are cheap to run on every
interaction.

Since you are working with sessions, the full set of session attributes is
worth knowing: `start`, `end`, `duration`, `landingPage`, `referrer`, and
`stats` with `pageviews`, `tabviews`, and `orders`. For a course platform,
combining duration with `session's stats' pageviews` often separates "left a
tab open" from "actually engaged" better than duration alone.
