C++11 std::chrno简单运用

本文介绍了一个简单的C++程序,该程序能够输出当前时间的10分之1秒的时间戳。通过使用标准库中的chrono组件,程序实现了高精度的时间获取,并将结果以易于理解的形式展示。
//该程序意在输出10分之1秒的系统时间戳
void printTimestamp(void)
{
    using namespace std::chrono;

    typedef typename duration<long, std::ratio<1, 10>> mseconds;
    time_point<system_clock, mseconds> tp = time_point_cast<mseconds>(system_clock::now());
    auto tmp = duration_cast<mseconds>(tp.time_since_epoch());
    auto timeStamp = tmp.count();

    printf("Current timeStamp(10 percent of a second)==%lu\n", timeStamp);
}

 

转载于:https://www.cnblogs.com/pureLaw/p/9252531.html

#include <vector> #include <iostream> #include <iomanip> #include <fstream> #include <sstream> #include <string> #include <string.h> #include <stdlib.h> #include <stdio.h> #include <ctype.h> #include <algorithm> #include <fcntl.h> #include <map> #include <math.h> #define chromoLL 44000000 #define maxN 20000000//28000 #define chromoL 900000 #define sWinN 1000 //300 //1000000 //500 //249 //1000000 #define maxLimit 300 #define chromoNo 10 #define maxLarge 56000 //60000 ,number of proteins #define maxNumFea 30000 //600000 #define Half 8000 #define trainPairs 14 #define M0 4 //4 #define M1 20 //10 positions #define M2 10 //10 intervals, jumping distance //#define PNclass "+1" using namespace std; //int pairRedund[maxLarge][2]; //int pairNoR[maxLarge][2]; //unsigned m,way,actualway; string feaArray[maxNumFea]; bool flagDomainA[maxLarge]; bool flagFeature[maxNumFea]; bool flagFeature2[maxNumFea]; long int totalF=0; long int totalF_ys=0; long int totalLine=0,totalE1=0,totalE2=0; long double threshV=0.01, eValueOri=1.0, nLE_eValueOri; vector <long int>arrayMethy[chromoNo]; vector <long int>arrayMethy_2[chromoNo]; int sP,eP,chrNo; int numP1,numP2,numP3; string annoStr,acceStr,sPstr,ePstr,geneTypeStr,geneOrientStr,chrNoStr; int arrayRow1[chromoLL]; int arrayRow2[chromoLL]; vector<int>posV; vector<long double>logPV; vector<int>meUnV; vector<string> vectorQ; ofstream coutE2("check_____formatError.txt"); ofstream coutE3("check_____startLargerEnd.txt"); ofstream coutE4("check_____repeatedGeneTypes.txt"); ofstream cout00X("irregular_ACCE_positions.txt"); ofstream coutSingleACCE("singleACCE.txt"); //ofstream fileOutE("Evalue larger than threshV.txt"); //ofstream fileOutE2("Evalue is NA.txt"); //ofstream coutTest("test signT.txt"); //the sum of lines of all files for one species //string pfamFeature[maxNumFea]; //string proteinPfam[maxN][3]; int TOUPPER(int c) { return toupper(c); } struct feaNode { int No; long double negaLogE; int realN; int biN; //}in
最新发布
03-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值