aboutsummaryrefslogtreecommitdiff
path: root/Program.cs
diff options
context:
space:
mode:
authorDemonKingSwarn <rockingswarn@gmail.com>2025-01-26 13:58:45 +0530
committerDemonKingSwarn <rockingswarn@gmail.com>2025-01-26 13:58:45 +0530
commit275a3459b8acf025b7ada074b9e574b44927dbcf (patch)
tree8b72f6480436b221bf5691032576da2a14259404 /Program.cs
parente832d4de9209236b6d222b7ce1c062fb9e66871c (diff)
downloadhypr-wellbeing-275a3459b8acf025b7ada074b9e574b44927dbcf.zip
hypr-wellbeing-275a3459b8acf025b7ada074b9e574b44927dbcf.tar.gz
chore: Total Screen Usage added
Diffstat (limited to 'Program.cs')
-rw-r--r--Program.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Program.cs b/Program.cs
index 5cd262a..340e338 100644
--- a/Program.cs
+++ b/Program.cs
@@ -46,12 +46,27 @@ class Program
data[key] = value;
}
}
+
+ TimeSpan totalTime = TimeSpan.Zero;
+
+ foreach (var entry in data)
+ {
+ if (TimeSpan.TryParse(entry.Value, out TimeSpan time))
+ {
+ totalTime += time;
+ }
+ }
+
+ Console.WriteLine($"Today's Screen Usage\t{totalTime}");
+ Console.WriteLine($"{red}{new string('-', 60)}{reset}");
Console.WriteLine($"{yellow}{"App",-30}{"Time",30}{reset}");
Console.WriteLine($"{red}{new string('-', 60)}{reset}");
+
foreach (var entry in data)
{
Console.WriteLine($"{blue}{entry.Key,-30}{reset}{green}{entry.Value,30}{reset}");
}
+
}
}