This Is A Custom Widget

This Sliding Bar can be switched on or off in theme options, and can take any widget you throw at it or even fill it with your custom HTML Code. Its perfect for grabbing the attention of your viewers. Choose between 1, 2, 3 or 4 columns, set the background color, widget divider color, activate transparency, a top border or fully disable it on desktop and mobile.

This Is A Custom Widget

This Sliding Bar can be switched on or off in theme options, and can take any widget you throw at it or even fill it with your custom HTML Code. Its perfect for grabbing the attention of your viewers. Choose between 1, 2, 3 or 4 columns, set the background color, widget divider color, activate transparency, a top border or fully disable it on desktop and mobile.

microtime

Returns the current Unix timestamp (epoch) with microseconds.

PHP

echo microtime();
// => 0.63928794 1242744141

Ruby

epoch_mirco = Time.now.to_f;
epoch_full = Time.now.to_i;

epoch_fraction = epoch_mirco - epoch_full;

puts epoch_fraction.to_s + ' ' + epoch_full.to_s;
# => 0.639287948608398 1242744141
By | 2009-05-19T14:48:01+00:00 May 17th, 2009|Categories: PHP, Ruby|Tags: , , , , |1 Comment

About the Author:

One Comment

  1. Todd August 6, 2010 at 3:58 pm

    There looks to be a slight difference in the precision of the two implementations. The ruby is much more precise to make the match we’d want to reduce that especially if using this function in an encryption scheme….

    epoch_mirco = Time.now.to_f;
    epoch_full = Time.now.to_i;

    epoch_fraction = epoch_mirco – epoch_full;

    puts epoch_fraction.to_s + ‘ ‘ + epoch_full.to_s;
    # => 0.639287948608398 1242744141

    # reduce 0.77425300
    puts sprintf(“%.8f %s\n”, epoch_fraction, epoch_full.to_s)

Comments are closed.