clock() precision in time.h
location: linuxexchange.com - date: December 21, 2011
I am trying to calculate the number of ticks a function uses to run and to do so an using the clock() function like so:
unsigned long time = clock();
unsigned long time2 = clock() - time;
printf("time elapsed : %lu",time2);
But the problem is that the value it returns is a multiple of 10000, which I think is the CLOCK_PER_SECOND. Is there a way or an equivalent function value that is more precise?
I am using Ubuntu 64-bit, but would prefer if the solution can work on other systems like Windows & Mac OS.
Linux clock losing time
location: linuxquestions.com - date: April 12, 2004
I've got a fairly new PC running SuSE 9.0. Everything runs okay, but I'm a bit worried because the clock seems to be losing time quite badly.
I haven't worked out if it's consistent, but it seems to lose more than a minute in every hour. I've had the machine on all day today, and it's lost more than a quarter of an hour.
It isn't a hardware problem, because it keeps perfect time when it's switched off, so it must be something funny going in Linux, or at least in something I'm running.
Does anyone have any ideas? Is there anything obvious I should be looking at?
Thanks for any advice.
Quick rundown of the setup:
Mobo: Asus A7N8X-E Deluxe
SuSE is the only OS installed on the machine; it was a fresh install with nothing else on the system. I'm using it as a desktop system, running KDE.
Ubuntu 14.10 and Windows 8.1 Dual Boot Clock and Time Problem
location: ubuntuforums.com - date: November 12, 2014
Hi All, I'm facing time difference problem between Windows and Ubuntu.
First of all I'd like to say that I have already tried modifying /etc/default/rcS, but surprisingly it's already UTC = no. Still I'm facing a time difference of few hours and have no idea what to do.
In both the OS I have internet time sync enabled. If I sync time from one OS, it gets different in another OS.
Date, clock and time zone settings
location: linuxquestions.com - date: May 5, 2008
What is difference between "
1. Hardware set to local time
2. Hardware clock set to UTC
And what does the following mean.
3. NTP server - automatic time synchronization (using NPT )
ubuntu, KVM and date/time clock problems
location: linuxquestions.com - date: March 28, 2011
I've been searching the web for about two days and have found sites that admit there are timing problems with KVM virtual machines but have not found a site that explains the problem in depth or how to correct it. Does anyone know of a good site that will explain the problems and how to correct them?
I'm running several VM Linux guests on a some Ubuntu hosts under KVM and all of them have severe clock issues. Within a week of setting the time and starting NTP they are all wrong by several hours, one was fast by nearly a day and a half. I've been a sys admin for nearly 20 years and have never seen such clock drift issues.
The physical hosts are all Dell 2850s and 2950s running Ubuntu with Kernel 2.6.28-18-server, that's Ubuntu 9 I believe (far more experience with RH than Ubuntu). The guest OS is RHEL 5.1. Running the command "cat /proc/cpuinfo |grep constant_tsc" does not produce output so I don't have a tsc on my CPUs. Since the guests are all RHEL 5.1
wall clock time of a running process
location: linuxquestions.com - date: June 26, 2006
I know with top I see cpu time but I want to know how long(wall clock)a process has been running. What is or is there a command for this??
Time Clock Punch Clock Software
location: linuxquestions.com - date: October 14, 2010
we need time clock software at work. must be FOSS. nothing fancy, just log-in, log-out, GUI, print at the end of the week. we will be running ubuntu. or should i patch a windows freebie from TUCOWS, etc...
Setting system date and time affecting the clock and date on BIOS
location: linuxquestions.com - date: September 20, 2007
Ubuntu 7.04 server amd64
Sometime strange happened here. Running "date -s ...." to set date and time of the system affecting the clock and date on BIOS.
The story is as follow;
Recently the date and time on the system was not correct. I changed a new battery and reset everything. Each day after booting the PC I have to run "date ..." to reset the time.
Just made following test
Booted the PC and entered BIOS page. It was found;
System Time 4 6 21
System Date Fri Sep 21 2007
reset them and exited BIOS setup. Rebooted PC and entered the BIOS page again. The date and time there was found correct. Reboot the PC checking it twice.
Then rebooted PC and login as user. Ran "sudo reboot" to reboot PC. Entered BIOS setup page and found the time and date being correct.
Rebooted PC again and login as uesr.
$ sudo date -s "09/20/2007 xx:xx:00"
to adjust date and time
$ sudo reboo
Clock on wrong time (system clock is set to UTC)
location: linuxquestions.com - date: July 24, 2011
So my BIOS clock is set to UTC and I keep setting the date with
lucid, linuxkvm, clock/time sources
location: ubuntuforums.com - date: June 25, 2010
I'm running several new virtual machine servers using kvm on lucid.
I've started noticing clock irregularities on my virtual machines. Their clocks are not properly syncing with the host using kvm-clock in /sys/devices/system/clocksource/clocksource0/current_clocksource.
I've read various reports around the Interwebs that kvm-clock is still a bit rough around the corners, and so it would seem. Interestingly, the system clock and the hardware clock on these virtual machines are off by a significant margin, as well.
I have also read reports that the TSC clock source (default on ubuntu server and our bare metal vm servers) has problems on SMP systems. So I was surprised to see it as the default in ubuntu server. Or have these been fixed in recent kernels?
I am wondering what the best practice is here. What's everybody else doing for clock sources and time keeping in their lucid kvm environments?
I am contemplating switching all the machines, bare metal and virtual, to the
Page: 1 2 3 4 5 6 7 8 9 10