diff --git a/src/main/java/net/lamgc/cgj/bot/event/BotEventHandler.java b/src/main/java/net/lamgc/cgj/bot/event/BotEventHandler.java index cf9459b..5e22dd2 100644 --- a/src/main/java/net/lamgc/cgj/bot/event/BotEventHandler.java +++ b/src/main/java/net/lamgc/cgj/bot/event/BotEventHandler.java @@ -188,7 +188,7 @@ public class BotEventHandler implements EventHandler { log.error("执行命令时发生异常", e); result = "命令执行时发生错误,无法完成!"; } - log.info("命令处理完成.(耗时: {}ms)", System.currentTimeMillis() - time); + long processTime = System.currentTimeMillis() - time; if(Objects.requireNonNull(result) instanceof String) { try { event.sendMessage((String) result); @@ -196,7 +196,10 @@ public class BotEventHandler implements EventHandler { log.error("发送消息时发生异常", e); } } - log.info("命令反馈完成.(耗时: {}ms)", System.currentTimeMillis() - time); + long totalTime = System.currentTimeMillis() - time; + log.info("命令反馈完成.(事件耗时: {}ms, P: {}%({}ms), R: {}%({}ms))", totalTime, + String.format("%.3f", ((double) processTime / (double)totalTime) * 100F), processTime, + String.format("%.3f", ((double) (totalTime - processTime) / (double)totalTime) * 100F), totalTime - processTime); } /** diff --git a/src/main/java/net/lamgc/cgj/pixiv/PixivDownload.java b/src/main/java/net/lamgc/cgj/pixiv/PixivDownload.java index e0d1dee..bcf94fa 100644 --- a/src/main/java/net/lamgc/cgj/pixiv/PixivDownload.java +++ b/src/main/java/net/lamgc/cgj/pixiv/PixivDownload.java @@ -285,7 +285,8 @@ public class PixivDownload { } /** - * 获取排行榜 + * 获取排行榜. + *
注意: 如果范围实际上没超出, 但返回排行榜不足, 会导致与实际请求的数量不符, 需要检查
* @param contentType 排行榜类型 * @param mode 排行榜模式 * @param time 查询时间 @@ -316,7 +317,8 @@ public class PixivDownload { int count = 0; Gson gson = new Gson(); ArrayList