Coral reefs began forming about 48 to 58 million years ago. The Great Barrier Reef, however was formed about 18 million years ago. Geological events such as the ice age have interrupted the growth of the Reef, but growth has been very rapid ever since.
Information from Australian Government's Great Barrier Reef Marine Park Authority