---
url: /dyad/dev/stdlib/BlockComponents/components/Sources.ContinuousClock.md
description: >-
  Dyad Sources.ContinuousClock docs.  Generates a continuous time signal that
  starts counting from a specified time.
---

# `Sources.ContinuousClock` {#Sources.ContinuousClock}

Generates a continuous time signal that starts counting from a specified time.

A clock component that outputs a continuously increasing signal starting from a specified time. The output equals the `offset` value until the simulation time reaches `start_time`, after which it increases linearly with time. The output value is calculated as `offset` + (`time` - `start_time`) when `time` exceeds `start_time`, otherwise it remains at the `offset` value.

This component extends from [`BlockComponents.Interfaces.Signal`](../types/Interfaces.Signal.md)

## Usage {#Usage}

`BlockComponents.Sources.ContinuousClock(start_time=0.0, offset=0.0)`

## Parameters: {#Parameters:}

|         Name |                                                    Description | Units | Default value |
| ------------:| --------------------------------------------------------------:| -----:| -------------:|
| `start_time` | Time at which the signal starts changing from its offset value |     s |           0.0 |
|     `offset` |                      Constant value added to the signal output |     – |           0.0 |

## Connectors {#Connectors}

* `y` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

## Behavior {#Behavior}

$$ \begin{align}
y\left( t \right) &= ifelse\left( \mathtt{start_time} < t, \mathtt{offset} - \mathtt{start_time} + t, \mathtt{offset} \right)
\end{align}
$$

## Source {#Source}

```dyad
"""
Generates a continuous time signal that starts counting from a specified time.

A clock component that outputs a continuously increasing signal starting from a
specified time. The output equals the `offset` value until the simulation time
reaches `start_time`, after which it increases linearly with time. The output
value is calculated as `offset` + (`time` - `start_time`) when `time` exceeds
`start_time`, otherwise it remains at the `offset` value.
"""
component ContinuousClock
  extends BlockComponents.Interfaces.Signal
relations
  "Output equals `offset` if `time` < `start_time`, otherwise increases with time"
  y = ifelse(start_time < time, offset + time - start_time, offset)
metadata {"Dyad": {"icons": {"default": "dyad://BlockComponents/ContinuousClock.svg"}}}
end
```

```dyad
"""
Generates a continuous time signal that starts counting from a specified time.

A clock component that outputs a continuously increasing signal starting from a
specified time. The output equals the `offset` value until the simulation time
reaches `start_time`, after which it increases linearly with time. The output
value is calculated as `offset` + (`time` - `start_time`) when `time` exceeds
`start_time`, otherwise it remains at the `offset` value.
"""
component ContinuousClock
  "Real-valued output connector for the component"
  y = RealOutput() {
    "Dyad": {
      "placement": {
        "icon": {"iconName": "default", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0},
        "diagram": {"iconName": "default", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0}
      }
    }
  }
  "Time at which the signal starts changing from its offset value"
  parameter start_time::Time = 0.0
  "Constant value added to the signal output"
  parameter offset::Real = 0.0
relations
  "Output equals `offset` if `time` < `start_time`, otherwise increases with time"
  y = ifelse(start_time < time, offset + time - start_time, offset)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/ContinuousClock.svg"}
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`ContinuousClock`](Sources.ContinuousClock.md)

  * [`ContinuousClock`](Sources.ContinuousClock.md)

  * [`Integrator`](Sources.ContinuousClock.md)
