StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
StackGenVis/frontend/node_modules/pretty-time
Angelos Chatzimparmpas e069030893 fix the frontend 3 years ago
..
node_modules fix the frontend 3 years ago
LICENSE fix the frontend 3 years ago
README.md fix the frontend 3 years ago
index.js fix the frontend 3 years ago
package.json fix the frontend 3 years ago
utils.js fix the frontend 3 years ago

README.md

pretty-time NPM version Build Status

Easily format the time from node.js process.hrtime. Works with timescales ranging from weeks to nanoseconds.

Install

Install with npm

$ npm i pretty-time --save

Usage

var pretty = require('pretty-time');

var start = process.hrtime();
var time = process.hrtime(start);
console.log(pretty(time));
//=> 3μs

API

By default, when no time increment is given as the second argument, the closest timescale is used (e.g. most granular without being less than zero).

Examples:

pretty([1200708, 795428088]);
//=> '2w'

pretty([800708, 795428088]);
//=> '1w'

pretty([400708, 795428088]);
//=> '5d'

pretty([70708, 795428088]);
//=> '20h'

pretty([12708, 795428088]);
//=> '4h'

pretty([3708, 795428088]);
//=> '1h'

pretty([208, 795428088]);
//=> '3m'

pretty([20, 795428088]);
//=> '21s'

pretty([0, 795428088]);
//=> '795ms'

pretty([0, 000428088]);
//=> '428μs'

pretty([0, 000000088]);
//=> '88ns'

pretty([0, 000000018]);
//=> '18ns'

Minimum time increment

(All of the following examples use [6740, 795428088] as the hrtime array.)

This value is passed as the second argument and determines how granular to make the time.

Examples

pretty(time, 'h');
//=> '2h'

pretty(time, 'm');
//=> '1h 52m'

pretty(time, 's');
//=> '1h 52m 21s'

Valid time increments

Any of the following may be used:

  • ns | nano | nanosecond | nanoseconds
  • μs | micro | microsecond | microseconds
  • ms | milli | millisecond | milliseconds
  • s | sec | second | seconds
  • m | min | minute | minutes
  • h | hr | hour | hours
  • d | day | days
  • w | wk | week | weeks

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on October 18, 2015.