First commit

This commit is contained in:
2025-12-25 11:16:59 +01:00
commit 0c5ca09a63
720 changed files with 329234 additions and 0 deletions

54
framework/client/timer.js Normal file
View File

@@ -0,0 +1,54 @@
/*
Copyright (c) 2020, 2023, The Unified Company.
This code is part of Unify.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE,
as published by the Free Software Foundation.
See the GNU AFFERO GENERAL PUBLIC LICENSE, for more details.
https://unifyjs.org
*/
export default class timer{
timings = new Array();
initialising = true;
lap( name ) {
var timing = new Object();
timing.time = new Date().getTime();
timing.name = name;
if( this.timings.length > 0 ) {
var previouseTiming = this.timings[this.timings.length - 1].time;
var timeBetweenPrev = ( timing.time - previouseTiming ) / 1000 ;
var firstTiming = this.timings[0].time;
var timeSinceFirst = ( timing.time - firstTiming ) / 1000 ;
//console.log("TimeBetween", timeBetweenPrev);
console.log("Time: ", timeSinceFirst, name);
}
this.timings.push( timing );
//console.log("TimeBetween", this.timings);
}
}