Case-cohort design has been advocated in many epidemiologic studies when studying rare diseases or events. In this design, with a rare event, all the events are selected for risk-factor assessment. When the event is not rare, it is desirable to consider a generalized case-cohort design, where only a fraction of events are sampled. We provide a valid test statistic to compare hazards functions between two samples for this generalized design and give a method for calculating power. Our result generalizes the result in Cai and Zeng (2004, Biometrics60, 1015-1024), and it shows numerically that efficiency loss due to sampling only part of the events is very low under nonrare-events situation.