fix(core): update

This commit is contained in:
2019-06-17 16:54:39 +02:00
parent 9935396f2d
commit f221e9c0fa
11 changed files with 433 additions and 397 deletions

View File

@@ -1,7 +1,7 @@
import * as plugins from './smarttime.plugins';
export * from './smarttime.classes.cronmanager';
export * from './smarttime.classes.date';
export * from './smarttime.classes.extendeddate';
export * from './smarttime.classes.hrtmeasurement';
export * from './smarttime.classes.timer';
export * from './smarttime.classes.timestamp';

View File

@@ -6,12 +6,12 @@ export class CronManager {
public cronjobs: plugins.cron.CronJob[] = [];
public addCronjob(cronIdentifierArg: string, cronFunctionArg: plugins.cron.CronCommand) {
const newCronJob = new plugins.cron.CronJob(cronIdentifierArg,cronFunctionArg);
const newCronJob = new plugins.cron.CronJob(cronIdentifierArg, cronFunctionArg);
if (this.status === 'started') {
newCronJob.start();
}
this.cronjobs.push(newCronJob);
};
}
/**
* starts the cronjob

View File

@@ -4,8 +4,8 @@ import * as process from 'process';
* easy high resolution time measurement
*/
export class HrtMeasurement {
nanoSeconds: number = null;
milliSeconds: number = null;
public nanoSeconds: number = null;
public milliSeconds: number = null;
private _hrTimeStart = null;
private _hrTimeStopDiff = null;
private _started: boolean = false;
@@ -13,7 +13,7 @@ export class HrtMeasurement {
/**
* start the measurement
*/
start() {
public start() {
this._started = true;
this._hrTimeStart = process.hrtime();
}
@@ -21,7 +21,7 @@ export class HrtMeasurement {
/**
* stop the measurement
*/
stop() {
public stop() {
if (this._started === false) {
console.log("Hasn't started yet");
return;
@@ -35,7 +35,7 @@ export class HrtMeasurement {
/**
* reset the measurement
*/
reset() {
public reset() {
this.nanoSeconds = null;
this.milliSeconds = null;
this._hrTimeStart = null;