# delaySubscription

Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers.

This operator is more efficient than `delay` but postpones all side-effects of subscription and affects error propagation timing.

The side-effects of subscribing to the source sequence will be run on the specified scheduler. Observer callbacks will not be affected.

## Arguments

1. `dueTime` *(`Number | Date`)*: Relative (Number) or Absolute (Date) time shift of the subscription.
2. `[scheduler]` *(`Scheduler`)*: Scheduler to run the subscription delay timer on. If not specified, the default scheduler is used.

## Returns

*(`Observable`)*: Time-shifted sequence.

## Example

```javascript
var start = Date.now()

var source = Rx.Observable
  .range(0, 3)
  .delaySubscription(5000);

var subscription = source.subscribe(
  function (x) {
    console.log('Next: %s, %s', x, Date.now() - start);
  },
  function (err) {
    console.log('Error: %s', err);
  },
  function () {
    console.log('Completed');
  });

//=> Next: 0, 5001
//=> Next: 1, 5002
//=> Next: 2, 5003
//=> Completed
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://soufatn.gitbook.io/rxjs-book/summary/observable/observable_instance_methods/delaysubscription.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
