Utilities

Alarm module

The MAL layer provides access to operating system functions.

MODULE alarm;

UNSAFE COMMAND alarm.ctime():str;
COMMENT "Return the current time as a C-time string.";

UNSAFE COMMAND alarm.epoch():int;
COMMENT "Return time since Jan 1, 1970 in seconds.";

UNSAFE PATTERN alarm.sleep(X_0:any_1):any_1;
COMMENT "Sleep a few milliseconds and return the slept value";

UNSAFE PATTERN alarm.sleep(X_0:any_1):void;
COMMENT "Sleep a few milliseconds";

UNSAFE PATTERN alarm.sleep(X_0:bat[:any_1]):bat[:any_1];
COMMENT "Sleep a few milliseconds and return the slept value";

UNSAFE COMMAND alarm.time():int;
COMMENT "Return time since program start in milliseconds.";

UNSAFE COMMAND alarm.usec():lng;
COMMENT "Return time since Jan 1, 1970 in microseconds.";

Identifier module

MODULE identifier;

COMMAND identifier.identifier(X_0:str):identifier;
COMMENT "Cast a string to an identifer";

COMMAND identifier.prelude():void;
COMMENT "Initialize the module";