Home > Back-end >  STD: : chrono: : duration is the number of belt unit, for the duration of this kind of feeling overl
STD: : chrono: : duration is the number of belt unit, for the duration of this kind of feeling overl

Time:04-23

 
The namespace NAU {

//unit number,
//Un_ : the form a
//v: how many quantity
//pul: each number unit
TemplateStruct AU {
TP_ v.
TP_ pul.

AU (const TP_ & amp; V_=TP_ (0), const TP_ & amp; Pul_=TP_ (1))
: v (v_), pul (pul_)
{}

Pul TP_ ToNormal const () {return v *; }//convert to normal unit value
};

Void Demo () {
Struct Second {};
AU Milis (0.001 50.0 f, f);//50 milliseconds 1
Printf (" 50 milliseconds is: % f seconds. \ n ", milis. ToNormal ());

STD: : chrono: : duration Dura (50.0 f);//50 milliseconds 1
Printf (" 50 milliseconds is: % f seconds. \ n ", STD: : chrono: : duration_cast & lt; STD: : chrono: : duration (dura). The count ());
}
}

  • Related