1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-01 11:25:01 +03:00

feat: add skill execution time in check script

This commit is contained in:
louistiti 2022-09-27 19:46:41 +08:00
parent 4d2fb56109
commit b7d496e6d6
2 changed files with 16 additions and 0 deletions

View File

@ -169,10 +169,12 @@ export default () =>
*/
try {
LogHelper.time('Skill execution time')
const p = await command(
'pipenv run python bridges/python/main.py scripts/assets/intent-object.json',
{ shell: true }
)
LogHelper.timeEnd('Skill execution time')
LogHelper.info(p.command)
LogHelper.success(`${p.stdout}\n`)
} catch (e) {

View File

@ -72,4 +72,18 @@ export class LogHelper {
public static default(value: string): void {
console.log(value)
}
/**
* Start a log timer
*/
public static time(value: string): void {
console.time(`🕑 \x1b[36m${value}\x1b[0m`)
}
/**
* Stop log timer
*/
public static timeEnd(value: string): void {
console.timeEnd(`🕑 \x1b[36m${value}\x1b[0m`)
}
}