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

  • Discounted Porn
    Marketing & Traffic Services
  • TokyoTechie
    Other Professional Services
  • Adult Male Content
    Online Content Providers
  • Premiere Listing

    Clickadu – Your trusted traffic souce

    More Details

RECENT

POPULAR

COMMENTS

Victoria Malfoy and Autumn Orchid In Sensual Girl-Girl Scene in ManyVids Release

Posted On 03 Sep 2025

RedGIFs Announces BullBossJosh as September Creator of the Month

Posted On 03 Sep 2025

Andie Anderson Stars in POV Scene from MILF VR

Posted On 03 Sep 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

Someone puts Gal Gadot in one of your vids? Take it down!

Posted On 13 Dec 2017

Hoping viewers can also enjoy a spooky...

Posted On 24 Oct 2023

now a days these type of games will get...

Posted On 17 Jul 2023

good move from adent. these type of...

Posted On 06 Jul 2023

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