Commit ccfca291 by Nick N. Sukharev

Внешняя функция external time_stamp(); заменена на внутренную функцию #getCurrentTime();

1 parent b5bd7d44
Showing with 12 additions and 12 deletions
......@@ -32,7 +32,6 @@ external function part_of_the_day(): string;
external function is_empty(check: unknown): boolean;
external function sleep_ms(duration: number): unknown;
external function json_encode(object: unknown): string;
external function time_stamp(): number;
external function math_floor(value: number, presision: number|empty = 0): number;
external function math_round(value: number, presision: number|empty = 0): number;
external function math_ceil(value: number, presision: number|empty = 0): number;
......@@ -50,7 +49,7 @@ start node root
do
{
$cjm.push("root");
set $conversation_start = external time_stamp();
set $conversation_start = #getCurrentTime();
goto caller_id;
}
transitions
......@@ -83,7 +82,7 @@ node caller_id
//external sendTelegram();
// Запоминаем временной штамп перед самой первой репликой
set $conversation_begin = external time_stamp();
set $conversation_begin = #getCurrentTime();
set $conv_start2 = external get_time();
#say("greeting");
var result = blockcall SkipMessagesBlock();
......@@ -770,7 +769,7 @@ node do_before_exit
do
{
$cjm.push("do_before_exit");
set $conversation_stop = external time_stamp();
set $conversation_stop = #getCurrentTime();
exit;
}
transitions
......@@ -854,3 +853,5 @@ digression record
}
}
......@@ -100,11 +100,6 @@ async function main() {
app.setExternal("json_encode", async (args, conv) => {
return JSON.stringify(args.object, undefined, 2);
});
app.setExternal("time_stamp", async (args, conv) => {
return Date.now();
});
app.setExternal("math_floor", async (args, conv) => {
return Math.floor(args.value, args.presision);
});
......@@ -340,9 +335,9 @@ async function main() {
if (shared.empty(conv_start)) conv_start = 0;
if (shared.empty(conv_begin)) conv_begin = 0;
if (shared.empty(conv_stop)) conv_stop = 0;
if (conv_start == 0) conv_start = ts;
if (conv_begin == 0) conv_begin = conv_start;
if (conv_stop == 0) conv_stop = Date.now();
if (conv_start == 0) conv_start = ts; else conv_start += ts;
if (conv_begin == 0) conv_begin = conv_start; else conv_begin += ts;
if (conv_stop == 0) conv_stop = Date.now(); else conv_stop += ts;
let output_data = JSON.stringify(result.output, undefined, 2);
......@@ -404,3 +399,7 @@ async function main() {
}
main().catch((err) => {console.error(err)});
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!