The first answer is - about 8 months. I learned that writing a book is a lot like riding a roller coaster. You know when get strapped in, but the rest is pretty fluid. So... technically you can figure out when you signed the contract, but, at least for me, the actual writing goes in fits and starts. Some days I was able to get a lot written or self edited. Other days found me wandering about the internet. End dates are easier because there is a final date when you can no longer edit and you must send the work to the publisher.
The second question is harder to answer with any accuracy. I started the research a bit by osmosis. I met people, asked questions, heard a lot of answers, which luckily led to more questions. I learned a lot over a decade. There are still many questions that I have yet to answer; much to be researched.
Took a tour today led by Gregory McReynolds. Wandered/rode around the foothills above New York Drive, above the Eaton Canyon Golf Course as Gregory pointed out geographical features and homes that date back to the late nineteenth and early twentieth century.
I love spending time with my "historical" comadres and compadres. There are areas of investigation that they have followed that lead me to explore things in a different way. Maybe they share some fact that turns a conclusion of mine upside down or they ask me about something they assume I might (should) know and that causes me to do some heavy investigation. It also enlightening to learn that as I get older I don't need to chase every item of interest. Sometimes it is a good thing to simply listen.