I've been asked a few times how long it takes to write a book. I can only answer for me, but even then it's not straightforward.
I wrote the first 3,000 words of Lives Interrupted in June 2007, although the idea and some of the characters had been bubbling away in the back of my mind for much longer than that.
I didn't write anything more until December, and then over January and February I added another 30,000 words in spurts of weekend writing and a couple of times during the week.
Then nothing until June 2008. I remember that time well as the company I worked for closed, and with that push I decided to work for myself. I had one small project during June and July, and spent the rest of the time writing. At the end of July I had finished the first draft.
I put the manuscript away for about two months while I turned my attention to getting some paying work, and then started editing.
Around March/April 2009 I sent my manuscript out to some agents and publishers in England. It was a waiting game and while I waited I started on the first draft of another book.
Months later I was asked for the full manuscript. Then more waiting. Eventually I heard from the publishers, it was a 'not for us' reply tempered with the comment they could see it had commercial potential, and with suggestions on some changes I could make.
I edited again based on those suggestions, and then wondered what to do. About this time I joined an advanced writing course, which formed the writing group I'm part of.
I spent about a year editing, sometimes in energetic spurts and then more slowly when I had less time. In November of last year I attended a workshop and met Mark Coker of Smashwords. That answered my question of whether or not to play the waiting game again with publishers and agents. I decided I would publish the book myself. I gave the manuscript to several beta readers and worked again on editing from their feedback.
Lives Interrupted was finally published and available on Amazon earlier this month - so how long to write a book? It has taken four and a half years from writing the first section to holding the book in my hand, although the idea was there for quite a while before I started writing, but on the other hand I haven't spent all of that time writing and editing.
Ultimately there isn't a single answer to the question. A book takes as long as it takes.