ALittleLov/dsh-clock-tools ↗★ 0

dsh-clock-tools

Host-measured task timing for DSH agents: a task_clock tool that does not touch presets 适合需要对智能体执行任务进行计时、规划和耗时分析的用户。

パッケージ
dsh-clock-tools
互換性
未検証
バージョン
0.1.8
ライセンス
MIT
最終更新
2026/10/25

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ALittleLov/dsh-clock-tools

ドキュメント

README 全文を読む ↗

2. 使用单调时钟测量经过时间

同一进程内,实际耗时用 performance.now() 的差值计算。墙钟(Date.now())只用于显示开始/结束时间,以及跨进程续算时的空档计算。

这样,普通的系统日期时间调整不会直接改变进程内连续运行的耗时结果。

使用

task_clock start   plannedSeconds=1200  label="写报告"
task_clock check
task_clock finish  outcome=completed
task_clock list
task_clock now

now 返回示例:

Now: 2026-10-23T20:33:01+08:00[Asia/Shanghai]

如果当前有 running 任务,会多一行:

Now: 2026-10-23T20:33:01+08:00[Asia/Shanghai]
Running task t-abc123: 1m 58s elapsed

返回示例(数字仅用于说明输出格式,不代表同一次真实测试;精确值以 tasks.json 里的毫秒字段为准):

Task t-abc123 (写报告): running
Started: 2026-10-23T18:29:00+08:00[Asia/Shanghai]
Elapsed: 1m 58s (monotonic, host-measured)
Planned: 20m 0s; remaining: 18m 2s
Task t-abc123 (写报告): completed
Started: 2026-10-23T18:29:00+08:00[Asia/Shanghai]
Ended: 2026-10-23T18:30:58+08:00[Asia/Shanghai]
Actual: 1m 58s (monotonic, host-measured)
Planned: 20m 0s
Variance: -18m 2s

注意:如果 Agent 没有 start,就没有有效起点;不能在任务结束后凭回忆补造耗时。