當前位置:編程學習大全網 - 網站源碼 - linux c++如何獲取系統時間?

linux c++如何獲取系統時間?

使用cstlib函數time,例如

# include & ltiostream & gt

# include & ltcstlib & gt

使用命名空間std

int main()

{

int t,h,m,s;

t =時間(0);

t = t % 86400

s = t % 60

t =(t-s)/60;

m = t % 60

t =(t-m)/60;

h = t;

cout & lt& lt“現在是”

返回0;

}

可以顯示

  • 上一篇:Sentinel基於並發線程數流控驗證
  • 下一篇:pycharm怎麽導入源碼
  • copyright 2024編程學習大全網