Javascript |
task:{
// ,
handler: ()=>{conslole.log("Hello world!")}
//
delay: 5000,
// , setTimeout setInterval
repeat: false,
// ,
name: "task1",
// ,
description: "This task created at the name of Invisible Pink Unicorn!"
// ,
at: "2017-09-20",
//
pid: 42
}
var verboseLogs = true,
verboseTime = true,
writeLogs = true;
var cs = new Chronoshift(verboseLogs, verboseTime, writeLogs) ;
cs.runTask( () => {console.log("task 1 executed")}, 3000);
cs.runTask( () => {console.log("task 1 executed")}, 3000)
[20.09.2017, 12:33:58.326]
Creating task: {"delay":3000}
[20.09.2017, 12:33:58.327]
Added a task task_7a0dh9bllhg with timeout 3000
2
task 1 executed
[20.09.2017, 12:34:01.327]
Task executed: task_7a0dh9bllhg
cs.setLogging(false, false, true);
//
cs.runTaskAt(()=>{console.log(" , !");}, "22:55", "German");
//
cs.runTaskAt(()=>{console.log(" !");}, "07-07 07:07:07", "p777", " ");
cs.runTask( () => {console.log("task 1 executed")}, 3000, false, "task1");
cs.executeTask("task1");
cs.stopTask("task1");
cs.restartTask("task1");
// ,
cs.runTask( () => {console.log("task 1 executed")}, 3000, false, "task1");
...
//- ,
cs.stopTask("task1");
...
//- , 4
cs.restartTask("task1");
// ,
// id
cs.removeTask(2);