← All procedures

algebra.pschedLengthTime

This function gives the time of `length` bytes at a rate of the packet scheduler, in nanoseconds (`psched_l2t_ns`). The kernel multiplies by its factor and does not divide. Thus a time can be 1 ns short: 1,500 bytes at 3,000,000 bytes per second give 499,999 ns, not 500,000.

CLI
Package
@procedures/algebra · README
Path
["algebra","pschedLengthTime"]
CLI
mark algebra pschedLengthTime --length <number> --rate <object>
As data
{"$proc":["algebra","pschedLengthTime"],"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","pschedLengthTime"], { length: 1, rate: {} });
console.log(JSON.stringify(result));

From the command line

$ mark algebra pschedLengthTime --length <number> --rate <object>

As data, in a program

{
  "$proc": ["algebra", "pschedLengthTime"],
  "input": { "length": 1, "rate": {} }
}

Input

FieldTypeRequiredDefaultDescription
lengthnumberyes
rateobjectyes

Output

The schema does not list fields (number).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "length": {
        "type": "number"
      },
      "rate": {
        "type": "object",
        "properties": {
          "rate": {
            "type": "number",
            "description": "This value is the rate in bytes per second."
          },
          "overhead": {
            "type": "number",
            "description": "This value is the overhead that the rate adds to each length."
          },
          "mpu": {
            "type": "number",
            "description": "This value is the least length that the rate counts."
          },
          "linklayer": {
            "type": "string",
            "enum": [
              "atm",
              "ethernet"
            ],
            "description": "An ATM link counts the length in cells of 48 bytes, and each cell takes 53 bytes."
          }
        },
        "required": [
          "rate"
        ],
        "additionalProperties": {}
      }
    },
    "required": [
      "length",
      "rate"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "number"
  }
}