Skip to content
Advertisement

Tag: time

Generating Total Time in Milliseconds in SQL Developer

I need to replicate the linux command “date +%s%3N” in SQL Developer. I have tried the below code sample but it returns with a different value. I have also done extensive searching Google with no luck. The date +%s%3N command returns something like: 1475615656692870653 Whereas the above code sample returns something like: 1475594089419116 The date command returns a longer and

Measuring execution time with clock in sec in C not working

I’m trying to measure execution time in C using clock() under linux using the following: The output is: The documentation says to divide the clock time by CLOCKS_PER_SEC to get the execution time in sec, but this seems pretty incorrect for a 2sec sleep. What’s the problem? Answer Sleeping takes almost no execution time. The program just has to schedule

linux c get system date format yyyymmdd

I want ask some questions 1) I want get string yyyymmdd of system date using linux c how should I do it ? And I want use this string do some arithmetic, like I have “20160317” I want do 20160317 – 90 get a new date,pls help 2) is there some cleaner way to do this? like if m =

Setting the right timezone, server and PHP

I need to set the right timezone. But I don’t understand if there is any difference between the PHP timezone (date_default_timezone_set()) and the Linux setting. Suppose I run a new AWS instance from N.Virginia. The default timezone of that server should be UTC-05:00 Does this mean that I have to set UTC-05:00 inside my PHP ini config? If I set

Running a shell script for a certain duration

I want to be able to run a script on Linux shell (bash) for a certain duration and sleep for a different duration. I’ve written something like the following snippet. However, I see only the sleep happening correctly but the execution stops after first execution. The response I get is ./script.sh: line 30: 1: not found. Maybe I’m missing something

What is the epoch of CLOCK_TAI?

Since Linux kernel version 3.10, the function clock_gettime() now accept CLOCK_TAI. I didn’t manage to find a detailed description of this clock. What is its epoch ? EDIT 1: Just compared the output of CLOCK_REALTIME and CLOCK_TAI on my Linux 3.19 OS and it returns the exact same value (1442582497) !? Is CLOCK_REALTIME decremented at leap seconds ? EDIT 2:

change date/time using python in linux

I tried using date command to change the system time in debian linux: os.system(“echo passwd | “sudo date -s “Thu Aug 9 21:31:26 UTC 2012”) and I set the python file permission to 777 and also chown as root. But it does not work and says date: cannot set date: Operation not permitted. Any Ideas? Thanks Answer Sudo doesn’t take

Advertisement