❔ Calculating reading duration percentages for different time periods
I'm working on a project where I need to calculate the reading duration percentages for different time periods based on user reading data. The time periods include dawn, night, evening, morning, and afternoon. I have the start and end times for each reading session, and I want to determine the percentage of reading time spent in each period.
I've already defined the time ranges for each period (e.g., dawn from 4:30am to 5:30am, night from 9pm onwards), and I need help with the logic to calculate the percentages. Additionally, there are cases where a reading session may span multiple periods (e.g., morning and afternoon).
I'm using .NET 6 linq, and any guidance or code snippets on how to approach this calculation would be greatly appreciated.
2 Replies
is this for homework or something?
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.