YNOT
  • Home
  • Industry News
    • Adult Business News
    • Adult Novelty News
    • YNOT Magazine
    • EU News
    • Opinions
    • Picture Galleries
  • PR Wire
    • Adult Company News
    • Adult Retail News
    • Adult Talent News
    • Adult Videos News
  • Podcasts
  • Industry Guides
    • Adult Affiliate Guide
    • Affiliate Marketing for Beginners
    • Top Adult Traffic Networks
    • Top Adult PR Agents
    • Funding an Adult Business
  • Business Directory
    • View Categories
    • View Listings
    • Submit Listing
  • Newsletters
  • Industry Events
    • Events Calendar
    • YNOT Cam Awards | Hollywood
    • YNOT Awards | Prague
    • YNOT Cammunity
    • YNOT Summit
    • YNOT Reunion
  • Login with YNOT ID
YNOT University: Educational articles and tutorials

Calculating Elapsed Time Using Perl

Posted On 27 Dec 2000
By : admin

Let’s say we need to figure out how long it has been since something happened and we either don’t know how (to use) or what the built-in functions are to do this.

Or perhaps you’d like to just understand how to do it without relying on those built-in functions.Let’s say we need to figure out how long it has been since something happened and we either don’t know how (to use) or what the built-in functions are to do this.

Or perhaps you’d like to just understand how to do it without relying on those built-in functions. It seems like something like this should be really easy to do (in some languages it is), but it is difficult finding tutorials which will explain how to accomplish this, so I have decided to show you one technique that you can use in your programs to accomplish the comparison of time. You only need to know how to get a timestamp and the rest we can build raw (that is my way of saying without using external libraries or built-in functions or modules). I am going to use Perl CGI as an example, but this same technique can be used in all languages (although of course the base function names will likely change).

This is a timestamp of the number of seconds since January 1, 1\’70, which is sometimes also referred to as the computer epoch. How do we know this besides me telling you? Use the table below as a guide:

seconds 1
minute 60
hour 3600
day 86400
week 604800

Now, the next time you see a timestamp you can say, “ahh, that is the number of seconds since January 1, 1\’70, the computer epoch!” (and people will probably look at you like you are on something). Seriously, as a programmer, though, you can tap into this clock and effectively use a stopwatch to determine the passage of time. That is what we are really going to focus on: stopping the time to mark an event. Consider the code below:

#!/usr/bin/perl
$past = \’57138777;
$present = time;
$seconds = int($present – $past);
print “Content-type: text/htmlnn”;
print “Seconds elapsed: $seconds”;

  • google-share
Previous Story

Climbing the Wall

Next Story

Gradient Buttons in less then a minute with Photoshop 6

Leave a Reply Cancel reply

You must be logged in to post a comment.

Sponsor

YNOT Shoot Me

YNOTShootMe.com has exclusive pics from adult industry business events. Check it out!

YNOT Directory

  • FUBAR Webmasters
    Photographers and Videographers
  • OMG International
    Novelty & Lingerie Distributors
  • AIP Daily
    News & Resources
  • Premiere Listing

    YNOT Mail

    More Details

RECENT

POPULAR

COMMENTS

Adult Superstar Sara Jay Asssits Sex Worker Advocay Group

Posted On 01 Jul 2025

Lily Starfire Plays the Game in New Brazzers Scene

Posted On 01 Jul 2025

‘Teachers Hookup After Hours’ on MILFuckd

Posted On 01 Jul 2025

Vanessa, Meet Vivid

Posted On 29 Sep 2014
Laila Mickelwaite and Exodus Cry

Laila Mickelwaite, Exodus Cry and their Crusade Against Porn

Posted On 03 May 2021

Sex Toy Collective Dildo Sculptor

Posted On 19 Mar 2019

Find a good sex toy is now a problem,...

Posted On 18 Mar 2024

Thanks to the variety of sex toys, I can...

Posted On 02 Feb 2024

I understand the concerns about...

Posted On 05 Jan 2024

Sponsor

Sitemap
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkPrivacy Policy