Emulation.setVirtualTimePolicy

Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets the current virtual time policy. Note this supersedes any previous time budget.

{
  "name": "setVirtualTimePolicy",
  "description": "Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets the current virtual time policy.  Note this supersedes any previous time budget.",
  "parameters": [
    {
      "name": "policy",
      "$ref": "VirtualTimePolicy"
    },
    {
      "name": "budget",
      "type": "number",
      "optional": true,
      "description": "If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent."
    },
    {
      "name": "maxVirtualTimeTaskStarvationCount",
      "type": "integer",
      "optional": true,
      "description": "If set this specifies the maximum number of tasks that can be run before virtual is forced forwards to prevent deadlock."
    }
  ],
  "returns": [
    {
      "name": "virtualTimeBase",
      "$ref": "Runtime.Timestamp",
      "description": "Absolute timestamp at which virtual time was first enabled (milliseconds since epoch)."
    }
  ],
  "experimental": true
}