#include <iostream>
#include <chrono>
#include <time.h>
#include <stdio.h>
using namespace std;
using namesapce chrono;
int main() {
int f;
time_t start, end;
time (&start);
cin >> f;
time (&end);
double dif = difftime (end, start);
printf ("Elapsed time is %.2lf seconds.", dif );
}
Run Code Online (Sandbox Code Playgroud)
大家好,我目前正在进行C++任务,基本上我需要在10秒内让用户输入内容.我设法找出如何计算秒的时间,但我需要它是毫秒,因为我必须找出10秒以上的毫秒数.我不熟悉C++,并且非常感谢任何可能有助于引导我朝着正确方向前进的建议.非常感谢