Ballerina API Documentation

Functions of ballerina.lang.system package

function currentTimeMillis() (int )

Gets the current system time in milliseconds

Parameters:

Parameter NameData TypeDescription

Return Parameters:

Return VariableData TypeDescription
intSystem time in milliseconds

function epochTime() (int )

Gets the current system time in epoch format

Parameters:

Parameter NameData TypeDescription

Return Parameters:

Return VariableData TypeDescription
intSystem time in epoch time

function getDateFormat(string format) (string )

Parameters:

Parameter NameData TypeDescription
formatstring

Return Parameters:

Return VariableData TypeDescription
string

function getEnv(string key) (string )

Gets the value of the specified environment variable.

Parameters:

Parameter NameData TypeDescription
keystringThe environment variable

Return Parameters:

Return VariableData TypeDescription
stringstring): The value of the specified environment variable

function log(int logLevel, any value)

Logs a float value

Parameters:

Parameter NameData TypeDescription
logLevelintLog level: 1 - Trace, 2 - Debug, 3 - Info, 4 - Warn, 5 - Error
valueanyany value to be logged

function nanoTime() (int )

Gets the current system time in nanoseconds

Parameters:

Parameter NameData TypeDescription

Return Parameters:

Return VariableData TypeDescription
intSystem time in nanoseconds

function print(any a)

Prints a 'any' value to the STDOUT

Parameters:

Parameter NameData TypeDescription
aanyany value to be printed

function println(any a)

Prints an any value to the STDOUT in a new line

Parameters:

Parameter NameData TypeDescription
aanyany value to be printed


Menu

  • Functions
    • currentTimeMillis() (int )
    • epochTime() (int )
    • getDateFormat(string format) (string )
    • getEnv(string key) (string )
    • log(int logLevel, any value)
    • nanoTime() (int )
    • print(any a)
    • println(any a)

Copyright 2017 Ballerina API Documentation