The negative feedback model for gene regulation of the circadian mechanism is described for the fruitfly, Drosophila melanogaster. The conservation of function of clock molecules is illustrated by comparison with the mammalian circadian system, and the apparent swapping of roles between various canonical clock gene components is highlighted. The role of clock gene duplications and divergence of function is introduced via the timeless gene. The impressive similarities in clock gene regulation between flies and mammals could suggest that variation between more closely related species within insects might be minimal. However, this is not borne out because the expression of clock molecules in the brain of the giant silk moth, Antheraea pernyi, is not easy to reconcile with the negative feedback roles of the period and timeless genes. Variation in clock gene sequences between and within fly species is examined and the role of co-evolution between and within clock molecules is described, particularly with reference to adaptive functions of the circadian phenotype.