diff --git a/lib/index.js b/lib/index.js index 893bb13..4d77121 100644 --- a/lib/index.js +++ b/lib/index.js @@ -31,8 +31,23 @@ function initialize(options){ } }; +/*section: dogapi + *comment: get the current POSIX timestamp + *example: | + * ```javascript + * var dogapi = require("dogapi"); + * dogapi.now(); + * // this is the same as + * parseInt(new Date().getTime() / 1000); + * ``` + */ +function now(){ + return parseInt(new Date().getTime() / 1000); +}; + module.exports.client = require("./client"), module.exports.initialize = initialize; +module.exports.now = now; module.exports.OK = 0; module.exports.WARNING = 1; module.exports.CRITICAL = 2;