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
intint: System time in milliseconds

function epochTime() (int )

Gets the current system time in epoch format

Parameters:

Parameter NameData TypeDescription

Return Parameters:

Return VariableData TypeDescription
intint: System 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 nanoTime() (int )

Gets the current system time in nanoseconds

Parameters:

Parameter NameData TypeDescription

Return Parameters:

Return VariableData TypeDescription
intint: System 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

function sleep(int t)

Halt the current thread for the specified time period

Parameters:

Parameter NameData TypeDescription
tintint: Sleep time in milliseconds


Menu

  • Functions
    • currentTimeMillis() (int )
    • epochTime() (int )
    • getDateFormat(string format) (string )
    • getEnv(string key) (string )
    • nanoTime() (int )
    • print(any a)
    • println(any a)
    • sleep(int t)

Copyright 2017 Ballerina API Documentation