judge: add HYDRO_TIME_USAGE & HYDRO_MEMORY_USAGE env var

This commit is contained in:
undefined committed 2024-10-18 05:47:11 +08:00
1 parent fa595142a2
commit affdadf3d2
1 file changed
+6 -1
+6 -1
View File
@@ -44,7 +44,12 @@ function judgeCase(c: NormalizedCase) {
user_stderr: fileIds.stderr ? { fileId: fileIds.stderr } : { content: '' },
score: c.score,
detail,
env: { ...ctx.env, HYDRO_TESTCASE: c.id.toString() },
env: {
...ctx.env,
HYDRO_TESTCASE: c.id.toString(),
HYDRO_TIME_USAGE: time.toString(),
HYDRO_MEMORY_USAGE: Math.floor(memory / 1024).toString(),
},
}));
}
} else if (status === STATUS.STATUS_RUNTIME_ERROR && code && detail) {