How best to use "downtime" during undergraduate research Due to the nature of my research, I find myself waiting many hours for my computer program to finish running in order to find more bugs in my code so that I can debug. I generally have a pretty good idea on the big picture of my project and what the next two or three tasks I have to complete are.

As an undergraduate, I am not directing my own research but I feel that I'm not using my time as well as I can during these "downtimes". There's a lot I don't understand in my project, so my mind wanders and I end up reading textbooks or general papers in hopes that I can increase my base knowledge in my field. This base knowledge doesn't directly benefit my capabilities in this project though. 

I also journal my thoughts and keep a constantly updated TODO list and list of questions I have which I work on, but I feel a sense of slow progress as I wait. Things I can do for example is read the library documentation or practice GDB debugging, etc. Of these things, I am not sure if they will even be that helpful.

I kind of want to ask for more work, but at the same time, there are a lot of unsolved problems in my current project; it's just that I can't constantly work on it since I must wait for some response from my programs I run. Thus, I don't feel that it's right for me to ask for more work since I can't even wrap up the work I'm doing right now. Am I doing something wrong?
It's often a good idea to have multiple things to do in parallel on a project, so that if one avenue is blocked for a short period of time (e.g. waiting for code to run, waiting for a supervisor to return a draft paper with comments) you can put effort into another avenue.

The things you're already doing sound good. You are basically using your time well - spending some of your time enhancing your base knowledge and skills pays off in the long run. You just feel uncomfortable because you don't see immediate tangible payoff for your current project. There are things you can do while your code is running that have a tangible payoff i.e. they directly contribute to things that you will have to do for your project at some point in the near future:


working on the slides for the next presentation you will have to give (the parts that don't rely on the results of the code that's currently running)
adding to an ongoing draft of a report, paper, or poster that describes your work (the parts that don't rely on the results of the code that's currently running)
searching for and reading literature that is directly relevant to your project
data analysis: when your code finishes running, start the next "run" and analyze the data from the first run while that's going


You can spend most of your time on the thing that is most immediately important (e.g. fixing and running your code) but work on the others in parallel when that is blocked. 

For bits of work you can do that generally advances your knowledge and abilities, but not necessarily specifically for your project, see What productive academic work can you do with minimal attention in a small (&lt;30 minutes) block of time?