---
title: finished
source: https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/finished
---

## Syntax

```js
newrelic.finished(time $time_stamp)
```

Records an additional time point as "finished" in a session trace, and sends the event to New Relic.

## Requirements

-   Browser Pro, Pro+SPA, or Lite agent (v593 or higher)
-   If you're installing the browser agent via npm and building a custom agent with selected features, you must enable the `generic_events` and/or `session_trace` feature when creating the `Agent` instance. In the `features` array, add the following:

    ```js
    import { GenericEvents } from '@newrelic/browser-agent/features/generic_events'
    import { SessionTrace } from '@newrelic/browser-agent/features/session_trace';

    const options = {
      info: { ... },
      loader_config: { ... },
      init: { ... },
      features: [
        GenericEvents
        SessionTrace
      ]
    }
    ```

    For more information, see the [npm browser installation documentation](https://www.npmjs.com/package/@newrelic/browser-agent#new-relic-browser-agent).

## Description

Records an additional time point when the page is finished according to your custom criteria, either before or after the page load event. This is useful, for example, for pages with many components that load asynchronously.

You can only call this method once per page load, and it does not change the other page load timing data recorded for the load. For an individual page load, this call:

1.  Adds a `finished` event to the current [browser session trace](https://docs.newrelic.com/docs/browser/new-relic-browser/browser-pro-features/session-traces-exploring-webpages-life-cycle), if one is in progress.
2.  Submits a [`PageAction` event](https://docs.newrelic.com/docs/insights/explore-data/attributes/browser-default-attributes-insights#pageaction-list) with the name `finished` to New Relic.

## Parameters

| Parameter                           | Description                                                                                                                                  |
| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `$time_stamp` _integer_ (UNIX time) | Optional. Defaults to the current time of the call. If used, this marks the time that the page is "finished" according to your own criteria. |

## Examples

```js
aboveTheFoldContent.on('ready', function() {
  newrelic.finished();
});
```
