English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to get the running time of a C++ code ..how can I use the time() function ?? are there any other function that can do the same thing??

2006-12-06 17:29:41 · 1 answers · asked by Anonymous in Computers & Internet Programming & Design

1 answers

Hmm, that might have been confusing, here's a better example:

#include // you'll need this for the time_t type

static void main( int argc, char * argv[] )
{
time_t currentTime;
currentTime = time( ¤tTime );
}

Note that some libraries let you get away with calling time like:
time(NULL);
or even:
time();

In any case, the end result is a long int of type time_t which can be used in a variety of ways, but is actually the number of seconds since 12am Jan 1st, 1970 GMT.

2006-12-06 17:49:13 · answer #1 · answered by TankAnswer 4 · 0 0

fedest.com, questions and answers