Sponsored Content
Full Discussion: Helpm with time function
Homework and Emergencies Homework & Coursework Questions Helpm with time function Post 302988352 by jim mcnamara on Saturday 24th of December 2016 09:47:37 AM
Old 12-24-2016
Want help? Show us your output as your code now produces please.
 

10 More Discussions You Might Find Interesting

1. Programming

C time in milliseconds function.

I need a c function which return the time in: hour min sec and mil sec I am writing on unix os. (3 Replies)
Discussion started by: kamil
3 Replies

2. Programming

find CPU Time for a function (subsecond precision)

Hi, I need to time a certain function in my C/C++ code and I am experiencing some difficulties. I timed it using wallclock time so I know that it takes approximately 500-600 microseconds with gettimeofday(&start, NULL); // my function call gettimeofday(&end, NULL); answer = (end.tv_sec -... (2 Replies)
Discussion started by: zynnel
2 Replies

3. Shell Programming and Scripting

time function

Hi, I would like to display the exact time taken to complete running a particular tool or function or program to user I don't know the exact time functions in unix, please help me thanks in advance Example: $test.ksh output should be The... (10 Replies)
Discussion started by: hsekol
10 Replies

4. Programming

function time

Hello I have problem with function 'time' to test my program for file copying . How to run the function in my source code ? I try something like that: system("time"); < -- but this don't working (2 Replies)
Discussion started by: scotty_123
2 Replies

5. Shell Programming and Scripting

Nawk Time Function

Hi All, I am using solaris and nawk. Is there any time function in nawk which is simliar to the shell `date` function ? Can any experts show any examples? (4 Replies)
Discussion started by: Raynon
4 Replies

6. Shell Programming and Scripting

Unix function to calcuate the difference in time

HI , I need to get the timedifference between two values... which funcation will help eg: difference betweem 19:22 and 19:43 should give 21 mins (2 Replies)
Discussion started by: savitha
2 Replies

7. UNIX for Dummies Questions & Answers

time function

hello everybody! i want to post a question. So, I use the command 'time a.out' to time the duration of the program a.out. The return value of this function was: real 0m4.116s user 0m4.112s sys 0m0.016s What i want is! I try to find a way to get (NOT manually) the value of real time.... (2 Replies)
Discussion started by: nicos
2 Replies

8. Red Hat

lightweight function for measuring time ( better than clock_getime )

HI I have a Red Hat Enterprise with Real Time kernel. Are you aware if there are C functions for this kernel or some code/library for this OS for measuring time more lightweight than clock_gettime and gettimeofday? THe hardware I have is NUMA. Reading forums I found gethrtime but it is... (1 Reply)
Discussion started by: manustone
1 Replies

9. Shell Programming and Scripting

/usr/bin/time Shell Scripting Function

Hello, I have made a Linux Shell Script that downloads 6 files from the Internet and then deletes them. Now i want to use the function "/usr/bin/time" and "bc" to calculate how long the avergate run time for the shell script is. I therefore need to do it 100 times. My shell script code is below: ... (6 Replies)
Discussion started by: solo2
6 Replies

10. OS X (Apple)

'time' does NOT work on a function in 'dash'.

Hi guys and gals... I am writing a piece of code that is dash compliant and came across this error. I have put it in the OSX section as that is what I am using. I have no idea what the 'dash' version is but was installed about 6 months ago. MBP, OSX 10.12.6, default terminal running dash on... (4 Replies)
Discussion started by: wisecracker
4 Replies
PX_INSERT_RECORD(3)													       PX_INSERT_RECORD(3)

px_insert_record - Inserts record into paradox database

SYNOPSIS
int px_insert_record (resource $pxdoc, array $data) DESCRIPTION
Inserts a new record into the database. The record is not necessarily inserted at the end of the database, but may be inserted at any position depending on where the first free slot is found. The record data is passed as an array of field values. The elements in the array must correspond to the fields in the database. If the array has less elements than fields in the database, the remaining fields will be set to null. Most field values can be passed as its equivalent php type e.g. a long value is used for fields of type PX_FIELD_LONG, PX_FIELD_SHORT and PX_FIELD_AUTOINC, a double values is used for fields of type PX_FIELD_CURRENCY and PX_FIELD_NUMBER. Field values for blob and alpha fields are passed as strings. Fields of type PX_FIELD_TIME and PX_FIELD_DATE both require a long value. In the first case this is the number of milliseconds since mid- night. In the second case this is the number of days since 1.1.0000. Below there are two examples to convert the current date or timestamp into a value suitable for one of paradox's date/time fields. Note This function is only available if pxlib >= 0.6.0 is used. PARAMETERS
o $pxdoc - Resource identifier of the paradox database as returned by px_new(3). o $data - Associated or indexed array containing the field values as e.g. returned by px_retrieve_record(3). RETURN VALUES
Returns FALSE on failure or the record number in case of success. EXAMPLES
Example #1 Set the date/time fields in a paradox database to the current date/time <?php $px = px_new(); $fp = fopen("test.db", "w+"); px_create_fp($px, $fp, array(array("timestamp", "@"), array("time", "T"), array("date", "D"))); $curdate = getdate(); $jd = gregoriantojd($curdate["mon"], $curdate["mday"], $curdate["year"]); $days = $jd - 1721425; /* Number of days between 1.1.4714 b.c. and 1.1.0000 */ $secs = $curdate["hours"]*3600 + $curdate["minutes"]*60 + $curdate["seconds"]; px_insert_record($px, array($days*86400000.0 + $secs*1000.0, $secs*1000.0, $days)); $curtimestamp = microtime(true); $days = (int) ($curtimestamp/86400); $secs = $curtimestamp - ($days * 86400.0); $days += 2440588; /* Number of days between 1.1.4714 b.c. and 1.1.1970 */ $days -= 1721425; /* Number of days between 1.1.4714 b.c. and 1.1.0000 */ px_insert_record($px, array($days*86400000.0 + $secs*1000.0, $secs*1000.0, $days)); for($i=0; $i<2; $i++) { $rec = px_retrieve_record($px, $i); echo px_timestamp2string($px, $rec["timestamp"], "n/d/Y H:i:s")." "; echo px_date2string($px, $rec["date"], "n/d/Y")." "; } px_close($px); px_delete($px); ?> The above example will output: 2/21/2006 21:42:30 2/21/2006 2/21/2006 20:42:30 2/21/2006 The Julian day count as passed to jdtogregorian(3) has a different base of 1.1.4714 b.c. and must therefore be calculated by adding 1721425 to the day count used in the paradox file. Turning the day count into a timestamp is easily done by multiplying with 86400000.0 to obtain milli seconds. SEE ALSO
px_update_record(3) PHP Documentation Group PX_INSERT_RECORD(3)
All times are GMT -4. The time now is 02:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy