Changes in rates of gene duplication influence the structure of genomes and affect the available source material for evolutionary novelties. One driver of duplication rates could be changes in the function of genes. However, there are only a few cases where higher duplication rates correlate with shifts in gene function. Here, we show that rates of duplication in the opsin gene family are related to gene function. To quantify rates of opsin duplication, we first needed a time tree for the gene family. We estimate that a lysine residue that may be diagnostic of opsins evolved 808-784 MY ago and most visual opsins originated 705-654 MY ago. Using the time tree and a binary state speciation and extinction (BiSSE) model, we estimated the birth and death (=duplication and loss) rates for opsins associated with both visual or non-visual character states. We find duplication rates of visual opsin clades significantly differ from non-visual clades (P<0.001). Our results identify crucial events for the evolution of animal vision on an absolute timeline, and demonstrate a case where duplication rates in gene families correlate with the evolution of new functions.