As an experienced software engineer, how long have you been idle, without work, and how did you keep yourself motivated to stay in the profession?
I've been a software engineer for nearly 30 years, and I've been laid off three times. In my experience, that happens to nearly everyone at some point, the other people answering this question seem to be quite fortunate on average.
The first layoff hit me hard, I was not expecting it, since my reviews were good, was busy on a project, etc. But it happened. They circulated my resume inside the company and another division picked me up right about the time I left work (back then they gave you a 2 week notice, now they walk you out the door immediately). I wanted some time off, so I was able to arrange a couple weeks off, but I could have started the new job almost right away.
The next layoff was the hardest. My company had been bought by Motorola, then they hit the dot-com bust. They laid off thousands of engineers in my area. I was competing against people who had a lot of connections, and my wife didn't want to move (previously I would just pack up and go to a new city). So that took 9 months to find new work (even longer if you count when I was employed but suspected the layoff would happen, so I was looking then too) and that was disheartening. Pretty much every day I was looking at the job boards, but there really wasn't much there. Companies would ghost you all the time after an interview. I noticed the medical field seemed immune to the tech recession. I did some side work for a friend completely unrelated to engineering for a few months. I rode my bike and exercised several days a week, so I lost some weight, which was good.
Eventually I did get a job. It wasn't even the best fit, but I had a friend there, and he apparently put in a good word. It wasn't the best job, but it was work, and paid almost as much as my previous work, I heard many people who had to take big pay cuts. That was the hardest time to be an engineer (2001–2003). I continued to watch the job boards, and when a job at a medical company I had seen earlier came up, I jumped on it, that job was seven years and good work.
Then the last time, I was working at a startup for about a year. I knew a startup is a bit risky, but again, I was surprised when the layoff happened. In this case, the engineering manager had several buddies from a previous job working under him, so he couldn't lay one of them off, and it fell onto me. That was a more normal situation, I had to look for a job, it took about 4 months. I found August is a bad time because so many people are on vacation. They may have a job posting, but they can't schedule interviews. Then September got busy, and in October I had 3 offers!
In summary, when I am unemployed, I spend several hours most every day on the job-finding business. Scanning job boards, polishing my resume etc. But I also take time for myself - get some things done that I had neglected, get some exercise etc. And maybe do some things to show the employers I'm not goofing off, like work on open source projects, do computer work for a non profit I'm involved with. I thought about getting a certification or even going back for a masters degree. And I've got enough hobbies, I'll never get actually bored.