Ubuntu :: Measuring The Time Of A Code?

Sep 20, 2010

I am a beginner to C and C++ and so far I have learned two ways to measure the time my program takes to run.

Method 1: Just compile your C file and if the executable is say a.out just type time ./a.out

Method 2: Here the general structure of the code is

Code:
#include<stdio.h>
#include<time.h>
int main(void)

[Code]....

Question 1 Do Method 1 and Method 2 return the same times?

Question 2 Method 1 gives three times real, usr and sys . Is it true that USR+SYS= TIME GIVEN BY METHOD 2

I have performed some experiments with small codes which return the squares of numbers uptill 36000 and I feel the answer to question 2 is yes

View 2 Replies


ADVERTISEMENT

Software :: Measuring Boot Time

Mar 19, 2009

I am using a simple plain Debian Lenny base system (No X). I would like to measure how many seconds my system takes to boot - time between hitting enter key on GRUB screen to login console on tty1.One obvious way is to measure it manually by looking at your wrist watch or an external timer but I would to measure it more accurately - something that is built inside the Operating System.

View 5 Replies View Related

Software :: Measuring Time Elapsed In A Program Gcc And G++

Jul 7, 2009

I've done a lot of googling for this, but always found code that does not work on my compiler.Could anyone please post a small (working) program through which I can store the starting time of the program (milliseconds) and get the ending time of the program in integer variables?Am working on Fedora 8, and with the gcc compiler.

View 2 Replies View Related

General :: Measuring Time That A Program Is Running In Shell Script

Nov 11, 2010

I have a script that executed 100000 C Programs, reads the commands from a file and executes them. There is a requirement to measuer the time that each of this 100K C programs running.If it exceeds 120 sec I want to Kill that Process.Any Idea to embed this in my shell script?

View 4 Replies View Related

Ubuntu :: Disable .pyc Byte Code From Saving Every Time Run .py

May 17, 2010

I am running ubuntu 9.10 and was wondering how to disable write access in python. I want to stop .pyc extensions from saving every time I run a .py file.

View 3 Replies View Related

Programming :: Execute Code For N Time?

Apr 23, 2011

I'm doing a program and I want it to execute some code during n seconds. For example e put a command in the shell like this 'ls % 10' and the program should run the command ls for 10 seconds.I'm trying something like this:

Code:
pid = fork();
if(pid == 0) {

[code]....

View 2 Replies View Related

Software :: Code Real Time Graphs On A Web Interface?

Jun 24, 2010

how graphs can be plotted on a web interface on real time ? I have a web interface coded in PHP mostly and for graphs I have jpgraphs. But the job needs the graphs to be real time not static. As of now there's a server side program that writes onto a csv file. I read data from the file and plot it using jpgraph when the page loads. Is there anyway I can code real-time dynamic graphs on a web interface ?

View 2 Replies View Related

Programming :: Measure CPU Time Spent On A Code Block (with C Or C++)?

Jul 31, 2011

I have a C program like this:

...
CODE_BLOCK;
...

I want to know how much CPU time spent on CODE_BLOCK. Since the process executing CODE_BLOCK may be preempted during execution, this CPU time may not be equal to the (wall-clock) time elapsed from the beginning of CODE_BLOCK to the end of it.

View 3 Replies View Related

Ubuntu :: Measuring Power - Watts?

Apr 11, 2011

I was wondering if there is a way to see how much power my computer is using while using Ubuntu. I know there are hardware devices, plugs, I can use but I didn't know if there was a computer program that I could use that would do the same thing. I am currently using an IONITX F-E, 2Gb 800mhz RAM, 6 Green WD 2TB drives, and plan on getting a blu-ray drive installed in the last slot. I am also using a PCI-E x4 SATA card, and using software raid 5. I have a 350 watt psu installed and would like to remove it and install a pico-psu but the pico seems to max out at 200 watts.

View 2 Replies View Related

Programming :: Link Code With The Real Time Library Using Qmake (.pro)?

Aug 23, 2010

I am trying to write suitable .pro file for my application. I need real-time library. Have you some ideas how to do that? I just need the line for linking with real-time library...

View 2 Replies View Related

General :: How To Program The Command Line To Run A Piece Of Code Multiple Time

Dec 4, 2010

So, I usually write/find a test case generator for any code that I write. This type of code generally leads to some file output. To be thorough, I try and generate many different files to test my code on.

Say the command is like this:

Is there a way to automate this for many different values of the parameters and generate many different files?

I tried:

I wasn't able to use the $i in the filename, and without it the command gave me no errors, but did nothing else either. I know the Unix command line is very powerful, and I have a feeling that this should be possible, but I just don't know how to do it.

View 3 Replies View Related

Hardware :: Measuring A Case Fan?

Mar 30, 2011

This is probably a simple question but I really don't know!How do you measure a case fan to know it's true deminsions whe one is talking about them or whatever?For an example lets use an 80 mm fan, is it measured from the "Frame" size witch is the total size of the fan or what?

View 14 Replies View Related

Hardware :: Ways Of Measuring FLOPS

Sep 25, 2010

I've found various programs and methods to measure FLOPS, but I don't seem to understand them. What is wrong with the following?

test-flops.py
Code:
#! /usr/bin/env python
float_increment = 1.03 # random
start = 57.24 # random
floating_point = start

for i in xrange(10 ** 6):floating_point += float_increment

Code:
PROMPT$ time ./test-flops.py
As far as I can see, this times a program that performs 1 million FLOPs (namely incrementation).

This outputs about 1.2 seconds on my (reasonably fast) machine, giving 840kFLOPS, which is much too low.This post may be in the wrong section; a C translation increments the result by three orders of magnitude (ie, py sucks), but this is still considerably less (~ 7-fold) than published values.

View 5 Replies View Related

Software :: Measuring Network Throughput

May 15, 2010

I want to know the actual maximum throughput of my lan at home.Could you suggest some free monitoring tools for me to use

View 2 Replies View Related

Programming :: Measuring Microseconds With Linux

Oct 27, 2010

I need to measure the time it takes for a program I'm writing to do Its job in microseconds resolution. I'm using Ubuntu 10.10. My Idea is, to write a device driver that directly reads the counter that produces the interrupt of RTC ticks. How do I do this, for a Linux kernel and a PC hardware?

View 4 Replies View Related

Debian Installation :: Measuring System Of Installer (JEDEC Or Metric)?

May 11, 2015

What measuring system does partitioning step in Debian installer use - metric or JEDEC? I.e. it uses MB, which in JEDEC means 1024^2 bytes, and in metric means 1000^2 bytes.

View 3 Replies View Related

Programming :: Selenium Java Code Into Equivalent Php Code?

Mar 30, 2011

I need to rewrite the selenium java code into its equivalent php code.

View 5 Replies View Related

Security :: Reset Facebook Password,facebook Send A Code To E-mail,this Code Can Be Sniffed By Sniff Software?

Jul 18, 2010

for reset Facebook password,facebook send a code to e-mail,this code can be sniffed by sniff software?

View 2 Replies View Related

Ubuntu :: After Log In Takes Long Time To Show Desktop, Monitor Events At Log In Time?

May 24, 2011

It takes me a while to log in the splash screen just sits there for ages before i get to the desktop. Never used to be this slow and I'm not sure why. Firstly, I'm running Ubuntu 11.04, standard DE. I do have conky starting up in a script but it has the & at the end of the line so I didn't think this would cause it (or is there some special case for log in time on how & is treated?). However as a test I will comment out the line in the script and see if it is the cause.

However just for general knowledge and in case that isn't the problem, how does one go seeing what is happening during the time from when one log's in and the desktop is displayed? Is there some kind of log that shows the date/time that can be enabled or is there a debug mode that can be enabled somehow via special keys or maybe from grub?

View 8 Replies View Related

Ubuntu Servers :: Get Notices That There Are Updates For The Server Software From Time To Time?

Mar 29, 2010

I have several file servers in our offices and I am relatively new to Ubuntu / Linux. I get notices that there are updates for the server software from time to time. Is it typical to update everything when available or should I follow "If it ain't broke, don't fix it..." mentality?I would hate for everything to be working fine and then have an update throw me a curve.

View 9 Replies View Related

Ubuntu Servers :: System Time Runs Slow Hareware Time Run Right?

Apr 11, 2011

I am running my Ubuntu 32 bit server on top of Windows 7 64 bit with VirualBox. It's a 2 core Atom. It's been working good for about half a year. But the last about 6 weeks the system time only in Ubuntu is going slow. About -8 per 24 hours! I can only guess because I have more things running in my Windows 7 and Ubuntu.

I can set it right by coping the hareware time to system time with this command:

Code:
hwclock --hctosys

I want to run a crontab to have that command run every minute. But it don't seem to run.

[Code]...

View 9 Replies View Related

Ubuntu :: Messed Up Vital Files Could Go Back In Time And Restore Computer To A Selected Time

Nov 26, 2010

For like windows you can resore your os to a state of peace kind of. If you messed up your vital files you could go back in time and restore you computer to a selected time. I was wondering if you could do that for ubuntu

View 4 Replies View Related

Ubuntu :: Screen / Everything Freezes From Time To Time For No Reason In Natty?

May 4, 2011

Ever since I installed Ubuntu Natty, from time to time, for no particular reason, the entire computer screen freezes, and I am forced to hold the power button on my laptop to restart things with a hard reset. I cannot explain why it happens.

Such an issue never occurred in any of the past installations and versions of Ubuntu. This is a fresh installation of Natty by the way.

Also, I can currently be running a lot or nothing and it does this. Thus, it does not matter what I am actually doing (ie, what programs I might be running).

It has occurred about 10 times since I freshly installed Natty 6 days ago.

View 9 Replies View Related

Ubuntu :: Booting Hangs From Time To Time (Lucid)?

May 3, 2010

I started out with Kubuntu RC, then installed ubuntu-desktop and updated all the way to the current state of packages.Anyway, from the moment I installed the RC, from time to time the boot splash appears, the dots light up/turn off and then the booting hags. No key seems to work.I the do a hard reset and everything works just fine.As not to open another thread:- how can I see the Ubuntu splash screen? (currently I can see the Kubuntu one)- how can I turn the splash off and have it boot in text mode?

View 3 Replies View Related

Ubuntu :: Set Time To Singapore Server With Time And Date?

Oct 28, 2010

I want to synchronize my time to a time server in Singapore. How can i do so with the Time and Date in System - Administration - Time and Date?

View 4 Replies View Related

Fedora :: 11 Boot Time / System Hangs For A Very Long Time On Starting Udev?

Sep 25, 2009

When booting Fedora 11, my system hangs for a very long time on starting udev. Sometimes I get an I/O error. However, my hardware is fine. I do eventually get in to the system.

View 7 Replies View Related

Fedora Installation :: Set The Time In The System Tray To The Standard AM/PM Setting Instead Of Military Time?

Jan 29, 2010

Just making one last tweak with my fresh install of F12KDE. I need to . How do I do this

View 2 Replies View Related

Programming :: Function Handler Is Called One Time Only Instead 2 Times If The 2 Timers Expires At A Time

Mar 2, 2011

I am using Debian linux. I have 100 timers running. If a timer expired which will generate a signal and it was mapped to a same function handler. All the timers are mapped to one function handler. The problem is if the timer expires one at a time, the function handler called at a time. But if the 2 timers expires at a time, the function handler is called one time only instead 2 times. Is it possible to invoke the function handler as many times based on timer expirary happens simultaneoulsy?

View 14 Replies View Related

Fedora :: Network Time Protocol Part Of Date / Time Settings

Oct 3, 2009

I've got fedora 11 set up to use network time protocol to sync my laptop's date & time when I'm on-line. The question is simple really, I've added a local universality's time server (what is public) and it's live. but it's added to the end of the default time servers what come with fedora. How do I get fedora to just use the local time server, is it a case of removing the default time servers for fedora, but there is a box what says advanced options which are. sync system clock before starting service ???? & use Local time source (( is that the same as the local ntp server that I've got set up ))Hope some body can help me with the network time protocol part of Date/Time settings.

View 9 Replies View Related

General :: Change The Creation Time Of All A Folder's Files To The Current Time?

Jun 19, 2011

Under a Linux shell, how can I change the creation time of all a folder's files to the current time?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved