mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-21 01:46:28 +08:00
judge: merge processTestdata
This commit is contained in:
1 parent
e4b916037c
commit
b74f6b64f8
15 files changed
+78
-152
No files matched your search
@@ -1,29 +1,9 @@
|
||||
import { format, inspect, InspectOptions } from 'util';
|
||||
import cac from 'cac';
|
||||
import { Time } from '@hydrooj/utils/lib/utils';
|
||||
|
||||
const argv = cac().parse();
|
||||
|
||||
namespace Time {
|
||||
export const second = 1000;
|
||||
export const minute = second * 60;
|
||||
export const hour = minute * 60;
|
||||
export const day = hour * 24;
|
||||
export const week = day * 7;
|
||||
export function formatTimeShort(ms: number) {
|
||||
const abs = Math.abs(ms);
|
||||
if (abs >= day - hour / 2) {
|
||||
return `${Math.round(ms / day)}d`;
|
||||
} if (abs >= hour - minute / 2) {
|
||||
return `${Math.round(ms / hour)}h`;
|
||||
} if (abs >= minute - second / 2) {
|
||||
return `${Math.round(ms / minute)}m`;
|
||||
} if (abs >= second) {
|
||||
return `${Math.round(ms / second)}s`;
|
||||
}
|
||||
return `${ms}ms`;
|
||||
}
|
||||
}
|
||||
|
||||
const colors = [
|
||||
20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62,
|
||||
63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113,
|
||||
|
||||
Reference in new issue
Block a user