mirror of
https://github.com/flynx/types.js.git
synced 2025-10-28 10:00:08 +00:00
added hi-res timestamp to Date.js
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
e82fcb5164
commit
fd3aba0055
9
Date.js
9
Date.js
@ -15,6 +15,15 @@ var object = require('ig-object')
|
||||
var DateMixin =
|
||||
module.DateMixin =
|
||||
object.Mixin('DateMixin', 'soft', {
|
||||
hires: function(){
|
||||
return typeof(process) != 'undefined' ?
|
||||
performance.timeOrigin + performance.now()
|
||||
: performance.timing.navigationStart + performance.now() },
|
||||
hiresTimeStamp: function(){
|
||||
var t = this.hires()
|
||||
var date = new this(t)
|
||||
return date.getTimeStamp(true) + (''+(t-date.getTime())).slice(1) },
|
||||
|
||||
timeStamp: function(...args){
|
||||
return (new this()).getTimeStamp(...args) },
|
||||
fromTimeStamp: function(ts){
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ig-types",
|
||||
"version": "6.20.4",
|
||||
"version": "6.21.0",
|
||||
"description": "Generic JavaScript types and type extensions...",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user