← All procedures

algebra.timerBand

This function gives the band of a timer from its bounds, exactly, in `unit`. The band goes from its duration less its early bound to its duration plus its lateness. A bound that the document does not give is zero. A duration without an end gives a band without an end. A keepalive of 11 s, 4 ms early and 352 ms late, gives 10.996 s to 11.352 s.

CLI
Package
@procedures/algebra · README
Path
["algebra","timerBand"]
CLI
mark algebra timerBand --bounds <object>
As data
{"$proc":["algebra","timerBand"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/algebra/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["algebra","timerBand"], { bounds: {} });
console.log(JSON.stringify(result));

From the command line

$ mark algebra timerBand --bounds <object>

As data, in a program

{ "$proc": ["algebra", "timerBand"], "input": { "bounds": {} } }

Input

FieldTypeRequiredDefaultDescription
boundsobjectyes
unitstringno

Output

The schema does not list fields (object | object).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "bounds": {
        "type": "object",
        "properties": {
          "duration": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "value",
                  "unit"
                ],
                "additionalProperties": {}
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string",
                    "const": "infinite"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "value",
                  "unit"
                ],
                "additionalProperties": {}
              },
              {
                "type": "object",
                "properties": {
                  "unknown": {
                    "type": "string"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "unknown"
                ],
                "additionalProperties": {}
              }
            ]
          },
          "lateness": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "value",
                  "unit"
                ],
                "additionalProperties": {}
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string",
                    "const": "infinite"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "value",
                  "unit"
                ],
                "additionalProperties": {}
              },
              {
                "type": "object",
                "properties": {
                  "unknown": {
                    "type": "string"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "unknown"
                ],
                "additionalProperties": {}
              }
            ]
          },
          "early": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "value",
                  "unit"
                ],
                "additionalProperties": {}
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string",
                    "const": "infinite"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "value",
                  "unit"
                ],
                "additionalProperties": {}
              },
              {
                "type": "object",
                "properties": {
                  "unknown": {
                    "type": "string"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "unknown"
                ],
                "additionalProperties": {}
              }
            ]
          }
        },
        "required": [
          "duration"
        ],
        "additionalProperties": {}
      },
      "unit": {
        "type": "string"
      }
    },
    "required": [
      "bounds"
    ],
    "additionalProperties": false
  },
  "output": {
    "anyOf": [
      {
        "type": "object",
        "properties": {
          "low": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "value",
                  "unit"
                ],
                "additionalProperties": {}
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string",
                    "const": "infinite"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "value",
                  "unit"
                ],
                "additionalProperties": {}
              }
            ],
            "description": "This time is the duration less how early the timer can fire."
          },
          "high": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "number"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "value",
                  "unit"
                ],
                "additionalProperties": {}
              },
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string",
                    "const": "infinite"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "value",
                  "unit"
                ],
                "additionalProperties": {}
              }
            ],
            "description": "This time is the duration plus how late the timer can fire."
          }
        },
        "required": [
          "low",
          "high"
        ],
        "additionalProperties": {}
      },
      {
        "type": "object",
        "properties": {
          "unknown": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          }
        },
        "required": [
          "unknown"
        ],
        "additionalProperties": {}
      }
    ]
  }
}