C++ systemC:sc_time_stamp()与其他变量进行比较

C++ systemC:sc_time_stamp()与其他变量进行比较,c++,systemc,C++,Systemc,我对usinfsc\u time\u stamp()有问题。 我想在time=20 因此: 1t1=sc_time_stamp(); 如果(t1.to_string()=“20”){cout我不知道那个函数,但根据sc_time的to_string()方法(我想是t1的类型),不仅打印时间的数值,还打印度量单位(“s”?ms”?ns”) 因此,举例来说(如果度量单位是秒),它可以工作 if ( t1.to_string() == "20 s" ) cout<<"Curren

我对usinf
sc\u time\u stamp()有问题。

我想在
time=20

因此:

1t1=sc_time_stamp();

如果(t1.to_string()=“20”){cout我不知道那个函数,但根据
sc_time
to_string()
方法(我想是
t1
的类型),不仅打印时间的数值,还打印度量单位(“s”?ms”?ns”)

因此,举例来说(如果度量单位是秒),它可以工作

if ( t1.to_string() ==  "20 s" )
    cout<<"Current time is "<< t1 << endl;
p、 对不起,我的英语不好

if ( t1 ==  20 )
    cout<<"Current time is "<< t1.to_string() << endl;