Throughput time for sub-activity

Hi team,

i have an activity table as follow:

activity_table(Case ID, Category, Activity, Timestamp)
A, Red, Activity 1, Jan 1 2020
A, Red, Activity 2, Jan 2 2020
A, Red, Activity 3, Jan 3 2020
A, Blue, Activity 4, Jan 10 2020
A, Blue, Activity 5, Jan 31 2020
B, Red, Activity 1, Jan 5 2020
B, Red, Activity 2, Jan 10 2020

Is there a way that i can aggregate the average throughput time per category to get the following result:

Red --> (3 + 5) / 2 = 4 days
Blue --> 21 days

Best,
Dominic