Sponsored Content
Top Forums Programming using usleep in c++ on diff platforms Post 47810 by Perderabo on Thursday 19th of February 2004 07:42:24 AM
Old 02-19-2004
What error are you getting? I'll bet it's just that usleep() is not there.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

diff 2 files; output diff's to 3rd file

Hello, I want to compare two files. All records in file 2 that are not in file 1 should be output to file 3. For example: file 1 123 1234 123456 file 2 123 2345 23456 file 3 should have 2345 23456 I have looked at diff, bdiff, cmp, comm, diff3 without any luck! (2 Replies)
Discussion started by: blt123
2 Replies

2. Programming

Makefile across platforms

EXE=auto SRCS=auto.cpp debug.cpp OBJS=auto.o debug.o CXX=g++ #HOSTFLAG=-DLinux HOSTFLAG=-DSunOS # Do not use compiler optimizer -O as this may break the program # Use debug flag to enable the debug() function. If DEBUG is not # defined than the function debug() is set to void(),... (1 Reply)
Discussion started by: laila63
1 Replies

3. UNIX for Dummies Questions & Answers

what do one mean when referring to 'platforms'?

what do one mean when referring to 'platforms'? (examples of platforms as listed below) alpha amd64 i386 ia64 pc98 sparc64 Thanks! (1 Reply)
Discussion started by: ninelives1980
1 Replies

4. UNIX for Dummies Questions & Answers

zipping across platforms

I saw a few posts on this, however, I am getting an error and don't see this particular issue. Not right off anyways.... We moved from digital OS to solaris 9 in Jan. On the old platform, I could gzip my files, ftp them to my win2000 desktop via hummingbird and then unzip them to view. Now,... (8 Replies)
Discussion started by: MizzGail
8 Replies

5. Shell Programming and Scripting

Simulate SVN diff using plain diff

Hi, svn diff does not work very well with 2 local folders, so I am trying to do this diff using diff locally. since there's a bunch of meta files in an svn directory, I want to do a diff that excludes everything EXCEPT *.java files. there seems to be only an --exclude option, so I'm not sure... (3 Replies)
Discussion started by: ackbarr
3 Replies

6. Solaris

usleep command is not available in SunOS

Hi All, I need usleep command to use in one of my shell script. I am working on SunOS 5.9. Where usleep command is not available. Is there any way to use usleep command in SunOS. Thanks In Advance, chidhu (5 Replies)
Discussion started by: pa.chidhambaram
5 Replies

7. UNIX and Linux Applications

Platforms using Unix

Hi ;) Which hardware platforms/machine types use the Operating System Unix? A list of all would be appreaciated Thx Megadrink :cool: (2 Replies)
Discussion started by: Megadrink
2 Replies

8. Shell Programming and Scripting

.procmailrc and uudeview (put attachments from diff senders to diff folders)

Moderator, please, delete this topic (1 Reply)
Discussion started by: optik77
1 Replies

9. Shell Programming and Scripting

serach diff filename in diff location using shell scripting

Hi, I am new to shell scripting. please help me to find out the solution. I need a script where we need to read the text file(consists of all file names) and get the file names one by one and append the date suffix for each file name as 'yyyymmdd' . Then search each file if exists... (1 Reply)
Discussion started by: Lucky123
1 Replies

10. Shell Programming and Scripting

Diff 3 files, but diff only their 2nd column

Guys i have 3 files, but i want to compare and diff only the 2nd column path=`/home/whois/doms` for i in `cat domain.tx` do whois $i| sed -n '/Registry Registrant ID:/,/Registrant Email:/p' > $path/$i.registrant whois $i| sed -n '/Registry Admin ID:/,/Admin Email:/p' > $path/$i.admin... (10 Replies)
Discussion started by: kenshinhimura
10 Replies
ggCurTime(3)								GGI							      ggCurTime(3)

NAME
ggCurTime, ggUSleep, ggUSlumber - Portable Time Routines SYNOPSIS
#include <ggi/gg.h> int ggCurTime(struct timeval *tv); int ggUSleep(int32_t usecs); void ggUSlumber(int32_t usecs); DESCRIPTION
ggCurTime fills the timeval structure pointed to by tv with the current time to the best precision available on the executing platform. ggUSleep sleeps for at least usecs microseconds, to the best precision available on the executing platform, but may be woken up by a signal or other unspecified condition. It is not guaranteed that ggUSleep will wake up prematurely for any specific reason. It is mainly useful for points where the main objective is to avoid using CPU resources, not to perform accurate timing. ggUSlumber does the same thing as ggUSleep, but is guaranteed not to return until the allotted time has elapsed. It is slightly less effi- cient than ggUSleep with reguard to CPU utilization. All times represent wall-clock (real, versus processor) times. The above routines are often simple macros rather than functions, and as such should not be used by reference. The above functions are threadsafe, but are not guaranteed to be safe to use in a thread that may be cancelled during their execution. They are also not guaranteed to be safe to use in special contexts such as LibGG task handlers, signal handlers and asyncronous procedure calls. RETURN VALUE
ggCurTime returns GGI_OK on success, or a negative value on failure. On Windows, this function will never report a failure. On platforms where gettimeofday(2) is used, the error code is the one returned by gettimeofday. ggUSleep returns GGI_OK when the alloted time interval has elapsed, or a non-zero value if the sleep was interrupted. On platforms where usleep(3) is used, the error code is the one return by usleep. EXAMPLE
A demonstration on how to measure a framerate. struct timeval start, stop, diff; long time_of_frame = 1; int framerate; ... ggCurTime(&start); /* do something here, i.e. render and display a frame */ ggCurTime(&stop); diff.tv_sec = stop_tv.tv_sec - start_tv.tv_sec; diff.tv_usec = stop_tv.tv_usec - start_tv.tv_usec; if (diff.tv_usec < 0) { diff.tv_usec += 1000000; diff.tv_sec--; } time_of_frame = diff.tv_sec * 1000 + diff.tv_usec / 1000; if (time_of_frame == 0) time_of_frame = 1; /* CPU too fast? */ printf("framerate: %i ", 1000 / time_of_framerate); SEE ALSO
gettimeofday(2), usleep(3) libgg-1.0.x 2005-08-26 ggCurTime(3)
All times are GMT -4. The time now is 09:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy