Did you do any validation on the book idea before you started writing? How much time did you invest before you decided to publish it?
The total time that went into the book is hard to put a number on. I'd say at least three months of dedicated writing, testing out theories in practice, editing, proof-reading and building up marketing momentum around it went into the book.