---
source_url: https://www.pubnub.com/docs/sdks/dart/api-reference/misc
title: Utility Methods API for Dart SDK
updated_at: 2026-06-18T11:27:28.001Z
sdk_name: PubNub Dart SDK
sdk_version: 7.1.0
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Utility Methods API for Dart SDK

PubNub Dart SDK, use the latest version: 7.1.0

Install:

```bash
dart pub add pubnub@7.1.0
```

The methods on this page are utility methods that don't fit into other categories.

## Pause

Call the `pause()` method to force the SDK to stop all requests to PubNub server when there are active subscribe channels.

### Method(s)

To `pause()` the data transmission you can use the following method(s) in Dart SDK.

```dart
pause()
```

This method doesn't take any arguments.

### Sample code

:::tip Reference code
This example is a self-contained code snippet ready to be run. It includes necessary imports and executes methods with console logging. Use it as a reference when working with other examples in this document.
:::

```dart
import 'package:pubnub/pubnub.dart';

void main() async {
  // Create PubNub instance with default keyset.
  var pubnub = PubNub(
    defaultKeyset: Keyset(
      subscribeKey: 'demo',
      publishKey: 'demo',
      userId: UserId('myUniqueUserId'),
    ),
  );

  // Subscribe to a channel
  var channel = "getting_started";
  var subscription = pubnub.subscribe(channels: {channel});

  subscription.messages.listen((message) {
    print('Received message: ${message.content}');
  });

  // Pause the subscription
  subscription.pause();
  print('Subscription paused.');
}
```

## Resume

Call the `resume()` method to force the SDK to try and reach out PubNub.

### Method(s)

To `resume()` the data transmission you can use the following method(s) in Dart SDK.

```dart
resume()
```

### Sample code

```dart
subscription.resume()
```

This method doesn't take any arguments.

## Time

This function returns the current timetoken value from the PubNub network.

:::note Algorithm constructing the timetoken
```javascript
timetoken = (Unix epoch time in seconds) * 10000000
```
Example of creating a timetoken for a specific time and date:
```javascript
08/19/2013 @ 9:20pm in UTC = 1376961606
timetoken = 1376961606 * 10000000
timetoken = 13769616060000000
```
:::

### Method(s)

To fetch Time you can use the following method(s) in Dart SDK:

```dart
time()
```

### Sample code

```dart
var response = await pubnub.time();
```

### Returns

The `time()` operation returns a `Timetoken` which contains the following operations:

| Method | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| value | int | Optional |  | Returns an `int` representation of current timetoken. |