Linked Questions

0 votes
1 answer
2k views

I'm working on a little school project to re-code the SpaceInvaders Game, without using ncurses, but only the basic libraries, and i want to use time to print my screen-buffer every time, so i need to ...
user avatar
-1 votes
1 answer
1k views

Currently I'm trying to time a process to compare with a sample program I found online that used opencl. Yet when I try to time this process I'll get very strange values as shown below. #include <...
Matt Hooper's user avatar
62 votes
10 answers
127k views

Are there types bigger than long long int in C++? My compiler is g++.
Michael's user avatar
  • 629
59 votes
4 answers
145k views

I do not know the data type of time_t. Is it a float double or something else? Because if I want to display it I need the tag that corresponds with it for printf. I can handle the rest from there for ...
user avatar
38 votes
4 answers
37k views

I want to make my code more platform-/implementation-independent. I don't know what a time_t will be implemented as on the platform when the code is being compiled. How do I know the type of t to ...
user avatar
12 votes
7 answers
45k views

I've got something like this: clock_t start, end; start=clock(); something_else(); end=clock(); printf("\nClock cycles are: %d - %d\n",start,end); and I always get as an output "Clock cycles are: 0 ...
eddy ed's user avatar
  • 967
26 votes
4 answers
15k views

I often experience situations where I want to print with printf the value of an integer type of implementation-defined size (like ino_t or time_t). Right now, I use a pattern like this for this: #...
fuz's user avatar
  • 94.7k
28 votes
2 answers
20k views

In my program, I stat the files they want and send the data over. The fields of a stat struct are all special types: struct stat { dev_t st_dev; /* ID of device containing file */ ino_t ...
Kasper's user avatar
  • 2,511
13 votes
3 answers
21k views

I would like to know if Microsoft Visual Studio 2010 supports C99. If not, how can I use the standard types like intptr_t and uintptr_t?
thetna's user avatar
  • 7,183
10 votes
1 answer
46k views

ls command prints time in this format: Aug 23 06:07 How can I convert time received from stat()'s mtime() into this format for local time?
kBisla's user avatar
  • 640
3 votes
3 answers
15k views

I need to find the time taken to execute a single instruction or a few couple of instructions and print it out in terms of milli seconds. Can some one please share the small code snippet for this. ...
Romaan's user avatar
  • 2,777
2 votes
1 answer
11k views

Does CLOCKS_PER_SEC varies from system to system or is it constant for an operating system or is it dependent on the processor of that particular system?? And also do help me explain the output of my ...
UltraRadiantx's user avatar
3 votes
2 answers
1k views

Or put differently, are there equivalents to intmax_t and %jd but for floating point numbers? This has already been asked as a side question here, but the question is so large that I think people ...
Ciro Santilli OurBigBook.com's user avatar
2 votes
1 answer
1k views

I'm trying to clock a sorting function, pretty straightforward stuff. Code looks like: clock_t start_t, end_t, total_t; start_t = clock(); sort(); end_t = clock(); total_t = (double)(end_t - start_t) ...
Colin Harrison's user avatar
-3 votes
1 answer
2k views

I found this code here. If I divide (t2-t1)/CLOCK_PER_SECwill i get time in seconds? How to I find CLOCK_PER_SEC? Is there any better way to find the execution time of a code or a function? #include&...
user avatar

15 30 50 per page