I’m working on a project with MPI and I want to write a logging system.
I want to ask you guys what should I use to get the current time in milliseconds ?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want the current local date and time, call the
GetLocalTimefunction.If you want the current date and time in UTC format, call the
GetSystemTimefunction.Both of these functions accept a single parameter, a pointer to a
SYSTEMTIMEstructure, which they fill in with the current date and time information.After calling the function, you can read the time out of that structure. The member you’re looking for would be
wMilliseconds, which returns the current millisecond (somewhere between 0 and 999).Sample code: