Task scheduling algorithms are crucial for optimizing the utilization of computing resources. This work proposes a unique approach for improving task execution in real-time systems using an enhanced Round Robin scheduling algorithm variant incorporating dynamic time quantum and priority. The proposed algorithm adjusts the time slice allocated to each task based on execution time and priority, resulting in more efficient resource utilization. We also prioritize higher-priority tasks and execute them as soon as they arrive in the ready queue, ensuring the timely completion of critical tasks. We evaluate the performance of our algorithm using a set of real-world tasks and compare it with traditional Round Robin scheduling. The results show that our proposed approach significantly improves task execution time and resource utilization compared to conventional Round Robin scheduling. Our approach offers a promising solution for optimizing task execution in real-time systems. The combination of dynamic time quantum and priorities adds a unique element to the existing literature in this field.