import/Task.js
/**
     * Marks the task as ended by setting the #endTime to the current timestamp
     * @param {Error} [error] Optional error as reason for ending
     */
Marks the task as ended by setting the #endTime to the current timestamp
@param {Error} [error] Optional error as reason for ending
Marks the task as ended by setting the #endTime to the current timestamp @param { Error } [ error ] Optional error as reason for ending
end(error)
    {
        if (!this.#endTime) {
            this.#endTime = Date.now();
            if (error) {
                this.#error = String(error);
            }
            this.emit("end", this.toJSON());
        }
        return this;
    }
end ( error ) { if ( ! this . #endTime ) { this . #endTime = Date . now ( ) ; if ( error ) { this . #error = String ( error ) ; } this . emit ( "end" , this . toJSON ( ) ) ; } return this ; }
Marks the task as ended by setting the #endTime to the current timestamp
 @param {Error} [error] Optional error as reason for ending
Marks the task as ended by setting the #endTime to the current timestamp @param { Error } [ error ] Optional error as reason for ending