From d3c97c36f8fd847f56fbcaaf148885e613a23fb4 Mon Sep 17 00:00:00 2001 From: Carter McBride <18412686+carterworks@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:05:04 -0600 Subject: [PATCH] Add performance tracking and last-update time --- src/pages/index.astro | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pages/index.astro b/src/pages/index.astro index 6235798..1d8b5a9 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,6 +1,6 @@ --- import getAllFeedItems from "../services/feeds"; - +const start = performance.now(); function isRecent(date: number): boolean { const now = Date.now(); const sixHours = 6 * 60 * 60 * 1000; @@ -13,6 +13,8 @@ const STATIC_CATEGORIES = { const yazzyUrl = import.meta.env.YAZZY_URL; const feedItems = await getAllFeedItems(); +const parseTime = performance.now() - start; +const updateTime = new Date().toLocaleString(); const categories = [ STATIC_CATEGORIES.All, @@ -150,6 +152,12 @@ const categoriesSelectorCss = categories